Write text to a file in RunMacro
Desktop ModeBrowser ModeRunMacro 3.5+
Write Text File writes content (with variables) to a file, choosing overwrite or create-new, encoding, and auto-create parents.
Dialog & quick setup

- Add a File › Write Text File command.
- Enter the file path and the content (variables allowed).
- Choose the mode: overwrite or create-new.
- (Optional) Set the encoding and enable create parent folders. Save.
Options reference
Modes & when to use
Desktop Mode
Operates on the local file system.
Browser Mode
Best for
- Export a processing result to a file.
- Save content composed from variables.
- Generate a config/script file from a template.
Use an alternative when
- You want to append lines to a log — use Append to Text File or Log Message.
Before you run
- 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.
Example workflow
Example: export a result to a file
- Write Text File: path
out/result.txt, contentResult: {result}, mode = overwrite, enable Create parent.
Expected result: The file holds the written content; the output variable holds the file path.
Tips & limitations
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.
- Create-new mode errors if the file already exists.
Applies to RunMacro 3.5+ · Desktop Mode & Browser Mode · Windows 10/11
