fileDescription:
The file executor reads, writes, or appends to a file on disk.
Parent: execute, then, else
Value (simple form): string specifying file name (reads contents)
Value (key/value form):
file: string, required, specifying file name (reads the content of the specified file)write: string, optional, specifying the text to be written into the file (default: null)append: string, optional, specifying the text to be appended to the file (default: null)# simple form
- file: (string)
# simple example
- file: '{folders.desktop}\favorites.txt'
# key/value form
- file: (string, required)
write: (string, optional)
append: (string, optional)
# key/value example
- file: '{folders.desktop}\favorites.txt'
append: '{words}'
EXAMPLE:
# add a set of words to a text file
commands:
- triggers:
- add {words} task
execute:
- file: '{folders.desktop}\tasks.txt'
append: |
{words}
- display: "Added '{words}' to '{folders.desktop}\\tasks.txt'"
- alert: |
FILE CONTENTS:
{file.text}
Additional Information:
file executor executes, subsequent executors in the same execution context can access the text from that file:
{file.text} - the text contents of the fileStatus: ✅ IMPLEMENTED