Files sub-actions¶
Delete file¶
Deletes a file from your computer. Be careful: it is removed for good, not sent to the recycle bin.
| Setting | What to put in |
|---|---|
| File | The file's full location on your computer, like C:\Stream\old.txt. |
| Fail if missing | Tick to get an error if the file is not there. Unticked, nothing happens when it is missing. Starts as: false. |
Variables it adds
| Variable | What it holds |
|---|---|
%fileDeleted% |
True if the file existed and was deleted |
Type id: core.deleteFile
File exists¶
Checks if a file or folder exists on your computer, then runs the True steps if it does or the False steps if it does not.
| Setting | What to put in |
|---|---|
| File or folder | The full location to look for, like C:\Stream\score.txt. |
| Look for | File = only count files. Folder = only count folders. Either = count both. Options: File, Folder, Either. Starts as: File. |
Paths it can take: True, False.
Variables it adds
| Variable | What it holds |
|---|---|
%fileExists% |
True if it was found |
Type id: core.fileExists
Read file¶
Reads a whole text file and saves everything in it in a variable. Good for showing text another program wrote, like a song title file.
| Setting | What to put in |
|---|---|
| File | The file's full location on your computer, like C:\Stream\song.txt. |
| Save in variable | The variable that receives the text, without % signs. The default fileContent means you use %fileContent%. Starts as: fileContent. |
Variables it adds
| Variable | What it holds |
|---|---|
%fileContent% |
All the text in the file (the variable name can be changed in the settings) |
Type id: core.readFile
Read lines from file¶
Reads a text file line by line. Every line gets its own variable: line0 is the first line, line1 the second, and so on.
| Setting | What to put in |
|---|---|
| File | The file's full location on your computer, like C:\Stream\list.txt. |
| Save in variable | The start of the variable names, without % signs. With the default line you get %line0%, %line1% and so on. Starts as: line. |
| Parse variables | Tick to replace any %variables% written inside the file with their values. Starts as: false. |
| Attempt auto-typing | Tick so a line that holds a number is stored as a real number. Untick if unsure. Starts as: false. |
Variables it adds
| Variable | What it holds |
|---|---|
%lineCount% |
How many lines the file has |
%line0% |
The first line (line1 is the second, and so on; the start of the name can be changed) |
%fileFound% |
True if the file was found |
Type id: core.readLines
Read random line¶
Picks a random line from a text file and saves it in a variable. Great for a list of jokes, quotes or ideas that you keep in a plain file.
| Setting | What to put in |
|---|---|
| File | The file's full location on your computer, like C:\Stream\jokes.txt. |
| Save in variable | The variable that receives the line, without % signs. The default randomLine means you use %randomLine%. Starts as: randomLine. |
| Skip empty lines | Tick to never pick an empty line. Starts as: true. |
| How many lines | How many different lines to pick. With more than 1, the extra ones go in randomLine1, randomLine2, and so on. Starts as: 1. |
| Parse variables | Tick to replace any %variables% written inside the line with their values. Starts as: false. |
| Attempt auto-typing | Tick so a line that holds a number is stored as a real number. Untick if unsure. Starts as: false. |
Variables it adds
| Variable | What it holds |
|---|---|
%randomLine% |
The picked line (the variable name can be changed in the settings) |
%lineNumber% |
Which line of the file it was, starting at 1 |
%lineCount% |
How many lines the file could choose from |
%fileFound% |
True if the file was found |
Type id: core.readRandomLine
Read specific line from file¶
Reads one chosen line of a text file, for example line 3, and saves it in a variable.
| Setting | What to put in |
|---|---|
| File | The file's full location on your computer, like C:\Stream\list.txt. |
| Save in variable | The variable that receives the line, without % signs. The default line means you use %line%. Starts as: line. |
| Line number (from 1) | Which line to read. 1 = the first line. If the file is shorter, you get an empty value. Starts as: 1. |
| Parse variables | Tick to replace any %variables% written inside the line with their values. Starts as: false. |
| Attempt auto-typing | Tick so a line that holds a number is stored as a real number. Untick if unsure. Starts as: false. |
Variables it adds
| Variable | What it holds |
|---|---|
%line% |
The line that was read (the variable name can be changed in the settings) |
%lineCount% |
How many lines the file has |
%fileFound% |
True if the file was found |
Type id: core.readSpecificLine
Write file¶
Writes text into a file on your computer, adding to the end or replacing everything. Good for feeding a text source in OBS, like a follower goal.
| Setting | What to put in |
|---|---|
| File | The file's full location, like C:\Stream\goal.txt. Cuebot creates the file if it is missing. |
| Text | The text to write. You can use %variables%, like "Latest follower: %user%". |
| Mode | Append = add to the end of the file. Overwrite = erase the file and write only this text. Options: Append, Overwrite. Starts as: Append. |
| End with a new line | Tick to finish the text with a line break, so the next write starts on a new line. Starts as: true. |
| Create missing folders | Tick to create the folders on the way if they do not exist yet. Starts as: true. |
Type id: core.writeFile