Insert text into beginning of file saved in iCloud/Document

Here’s an action that should be capable of this. It works by utilising a combination of shell scripts and Draft’s file manager in the scripting.

Here’s the in action description.

Prepend the content of the current draft to a file path outside the Drafts sandbox, as specified by the tag PATH in this action.

IMPORTANT:

  1. This action will not work on i*OS.
  2. The file to be appended to must already exist.

For the default value of PATH, I’ve just used $HOME/Library/Mobile Documents/com~apple~CloudDocs/Test/example.txt, but it works for the Desktop path, Documents path, etc. You’ll just be prompted to confirm permission for access.

Hope that helps.