Docs
RunMacro Documentation
Learn RunMacro from basics to advanced.
Everything you need to start and master RunMacro — from basic commands to advanced automation workflows.

Read a text file into a variable in RunMacro
Read Text File loads a file's full content into a variable, with a chosen encoding and read-size cap.
Prerequisites
- The file exists and is readable.
Supported modes
- Desktop Mode — Operates on the local file system.
- Browser Mode
What it does
The Read Text File command opens a text file and loads its whole content into a variable for later steps. You choose the encoding (default UTF-8), how to handle bad characters, and a size cap to guard against huge files.
When to use it
- Load a config/template from a text file.
- Read input data to process.
- Get file content to compare or extract from.
When not to use it
- Tabular data (CSV/Excel) to loop row by row — use the Data Source.
Configuration steps
- 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.
Every option explained
Expected result
The content variable holds the file text; the path variable holds the read file.
Real example
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).
Limitations and failure cases
- Files over the size cap are refused.
Tips & common mistakes
If the file uses an odd encoding, set Errors = replace to avoid stopping mid-run.
Verification details
commands/filesystem.py
RunMacro