Link Search Menu Expand Document
Table of contents
  1. Flow - drcreate
    1. Description
    2. Variables
      1. Used
      2. Created
    3. Termination
    4. Flow
    5. Scripting
      1. Sample Code (AppleScript)
      2. URL
    6. Notes

Flow - drcreate

Description

Creates a new draft in Drafts either using a URL scheme (opening in the foreground), or AppleScript (creating in the background. The flow supports different options for different routes, and the route to be taken should be specified via the OpenDraft variable when calling this trigger.

  • Prefixing content to lines is supported by all methods.
  • Flagging and tagging is supported by the AppleScript (create in background) method.
  • Running an action on the new draft is supported by the URL scheme (create in foreground) method, and will be forced if triggered for a background open method.

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.
OpenDraft * Set to true or false and determines the route through the flow.
action The name of an action to execute on the new draft once it has been created if the draft is to be opened.
flagged Set as true or false to indicate if the new draft should be flagged or not, if the draft is to be created in the background.
prefix The text to prepend to each content line.
tags A comma separated list of tags to add to the new draft, if the draft is to be created in the background.

* 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.
NotificationTitle The title to be shown in any completion notification.
NotificationMessage The message to be shown in any completion notification.

Termination

Flow

drcreate

Scripting

Sample Code (AppleScript)

tell application id "com.runningwithcrayons.Alfred" to run trigger "drcreate" in workflow "com.thoughtasylum.doctordrafts" with argument "Lorem ipsum dolor sit amet"

URL

alfred://runtrigger/com.thoughtasylum.doctordrafts/drcreate/?argument=Lorem%20ipsum%20dolor%20sit%20amet

Notes

  • Supports new lines from Alfred input as “\n”.
  • Supports tab characters from Alfred input as “\t”.