Read a text file into a variable in RunMacro
Desktop ModeBrowser ModeRunMacro 3.5+
Read Text File loads a file's full content into a variable, with a chosen encoding and read-size cap.
Dialog & quick setup

- Add a File › Read Text File command.
- Enter the file path.
- (Optional) Choose the encoding and error handling.
- (Optional) Set a size cap and rename the content variable. Save.
Options reference
Modes & when to use
Desktop Mode
Operates on the local file system.
Browser Mode
Best for
- Load a config/template from a text file.
- Read input data to process.
- Get file content to compare or extract from.
Use an alternative when
- Tabular data (CSV/Excel) to loop row by row — use the Data Source.
Before you run
- The file exists and is readable.
Example workflow
Example: load a list from a file
- Read Text File: path
list.txt, content variablelines. - Use
{lines}in later steps (e.g. split lines to loop).
Expected result: The content variable holds the file text; the path variable holds the read file.
Tips & limitations
If the file uses an odd encoding, set Errors = replace to avoid stopping mid-run.
- Files over the size cap are refused.
Applies to RunMacro 3.5+ · Desktop Mode & Browser Mode · Windows 10/11
