Link Search Menu Expand Document
Table of contents
  1. Flow - drnew
    1. Description
    2. Variables
      1. Used
      2. Created
    3. Termination
    4. Flow
    5. Notes

Flow - drnew

Description

Creates a new draft in Drafts using AppleScript, and so not bringing the Drafts application to the foreground. The flow supports setting the flagged status of the new draft, as well as adding tags, and prefixing all lines with additional text. This can be useful for setting up Markdown lists (numbered or bulleted) for example.

Variables

Used

The following variables can be passed in and will be processed by the flow.

Variable Description
query * The base content to populate the new draft with.
flagged Set as true or false to indicate if the new draft should be flagged or not.
prefix The text to prepend to each content line.
tags A comma separated list of tags to add to the new draft.

* These are mandatory for triggering this flow.

Created

The following variables are set-up by the flow.

Variable Description
content The (modified) content to populate the new draft with.
OpenDraft Always set to false, and determines the route through the flow.
NotificationTitle The title to be shown in any completion notification.
NotificationMessage The message to be shown in any completion notification.

Termination

Flow

drnew

Notes

  • Supports new lines from Alfred input as “\n”.
  • Supports tab characters from Alfred input as “\t”.
  • Accessing environment variables from an AppleScript run from within Alfred encounters UTF encoding issues. For this reason the AppleScript utilises embedded shell script to get the content and tags environment variables - i.e. in case they contain accented characters, etc.