Docs

RunMacro Documentation

Create your first robot, then go further as needed.

Clear step-by-step guides to create, run, and improve robots for repetitive computer work.

Docs File Write Text File
💾 File

Write text to a file in RunMacro

Write Text File writes content (with variables) to a file, choosing overwrite or create-new, encoding, and auto-create parents.

Prerequisites#

  • The file path is resolved and the parent exists or Create parent is enabled.
  • The process can create or overwrite the file under the selected mode.

Supported modes#

  • Desktop Mode — Operates on the local file system.
  • Browser Mode

What it does#

The Write Text File command writes your content (with optional variables) to a file. Choose overwrite or create-new (errors if it exists), set the encoding, and auto-create parent folders. Overwrite uses a safe write (temp file then atomic replace).

Screenshots & video#

RunMacro Write Text File command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Write Text File command in RunMacro.

When to use it#

  • Export a processing result to a file.
  • Save content composed from variables.
  • Generate a config/script file from a template.

When not to use it#

  • You want to append lines to a log — use Append to Text File or Log Message.

Configuration steps#

  1. Add a File › Write Text File command.
  2. Enter the file path and the content (variables allowed).
  3. Choose the mode: overwrite or create-new.
  4. (Optional) Set the encoding and enable create parent folders. Save.

Every option explained#

File path#

The file to write (default output.txt). Supports variables.

Text#

The text to write. Insert variables with {name}.

Mode#

overwrite (replace existing) or create_new (error if the file exists).

Encoding#

Default utf-8.

Create parent#

If on, creates missing parent folders before writing.

Output variable#

Variable that receives the written path (default last_written_path).

Expected result#

The file holds the written content; the output variable holds the file path.

Real example#

Example: export a result to a file#

  1. Write Text File: path out/result.txt, content Result: {result}, mode = overwrite, enable Create parent.

Limitations and failure cases#

  • Create-new mode errors if the file already exists.

Tips & common mistakes#

Overwrite replaces the old content. Use "create-new" if you must not clobber an existing file.
To append to the end of a file instead of overwriting, use the Append to Text File command.

Verification details#

  • commands/filesystem.py
RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.