Docs

RunMacro Documentation

Learn RunMacro from basics to advanced.

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

RunMacro robot
Docs File Read Text File
📖 File

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 ModeOperates 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

  1. Add a File › Read Text File command.
  2. Enter the file path.
  3. (Optional) Choose the encoding and error handling.
  4. (Optional) Set a size cap and rename the content variable. Save.

Every option explained

File path

The text file to read. Supports variables; matches Unicode names if needed.

Encoding

Default utf-8. Change it if the file uses another encoding.

Errors

strict (error), replace (substitute bad chars), or ignore (drop them).

Max bytes

Blocks reading a file larger than this (default ~10MB). 0 = no limit.

Content variable / Path variable

Variable for the content (default file_content) and for the read path (last_read_path).

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

  1. Read Text File: path list.txt, content variable lines.
  2. 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 robot

Ready to automate smarter?

Download RunMacro and start automating your desktop, browser, and business workflows today.