KeyRoutines
StepFreefile.appendText

Add a line to a text file automatically on Windows

Add text to file writes new text at the end of a text file without touching what is already there. It is the easy way to keep a running log, a journal entry per day, or a list of things a routine has handled.

How it works

  • You choose the file and the text to add; the text can include values from earlier steps or the trigger.
  • By default the new text starts on its own line when the file already has something in it, which suits one-entry-per-line logs.
  • If the file doesn't exist yet it is created, along with the folder it belongs in.
  • Text is saved as UTF-8, and a folder trigger watching the same folder won't fire because of this write.
  • A dry run only reports what it would write.

Routines that use it

Log every finished download

When Download finished fires, add the file's name and the time to a downloads log in your Documents folder.

Track when you start gaming

A routine that runs on Game started appends a dated line, so you can later read the file back and see how often you played.

Quick notes from a hotkey

Press a Hotkey, type a thought into Ask for input, and Add text to file saves it to the bottom of your notes file.

Settings

SettingWhat it does
PathThe text file. It is created when missing.
TextWhat to add at the end.
On new lineStart on a new line when the file already has text.

Good to know

  • Undo file moves doesn't take appended text back out; only files a step newly created can be undone.

Questions

How do I make a simple log file of a routine's actions?
Add an Add text to file step and point it at a .txt file. Each run adds one new line at the end, so the file builds up into a log over time.
Does it overwrite what's already in the file?
No. It only adds to the end. If you want to replace the contents, use Write text file instead.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.