Page icon

Write Text File Output

The Write Text File Output writes text to a file.

Setup

Configuration

Filename sets the location of the file to write to. It can be an absolute or relative path.

If exists determines the action to take when the file is found.

The checkboxes control if a unique identifier should be added to the name (useful for temporary files), if intermediary folders should be created for complex paths, and if files should be created when given empty text.

If Relative is applicable when Filename is relative and ignored otherwise. It defines where to save the file.

The text area determines the text to write to the file. Dynamic Placeholders are supported and can be quickly added (or configured to be ignored) via the {} button. Most often you'll use {query} or {var:} to reference values that were passed-in or saved earlier in the workflow.

Connection Ideas

Connect to the Write Text File Output to update the contents of a file with the output of a command from a Run Script Action or Automation Task, or with typed text from a Keyword Input or Text View.

The path of the written file is output the next object.

Example Workflows

Advanced

With Add a UUID to filename on, the new string is added before the file extension. So for the Filename /tmp/my-file.txt, adding a UUID would generate something like /tmp/my-file-A62813C5-DD66-48DB-B730-C2E6E27319E9.txt. The ultimate file path is taken into account when sending output to the next object.

When saving to a relative path, the best choice of location for Is Relative depends on the contents of the file and how relevant they are to the rest of the workflow:

  • The data folder is for local information which cannot be automatically recreated, such as data provided by the user.
  • The cache folder is for temporary information which is automatically recreated, such as data from an external website.
  • The workflow's folder is for data which should be included and synced with the workflow. Keep in mind this is included when exported so avoid it for workflows shared with third parties.

To define a full path under the home directory, start it with a tilde: ~/Documents/Manuals instead of /Users/alfred/Documents/Manuals.