macaroni

file

Description:
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):

# 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:

Status: ✅ IMPLEMENTED