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

Flow - drpaste

Description

This flow can deal with two different types of input. The input type is determined by the value of the fetch variable.

If fetch is not set, or is set to false, the query passed in is taken to be transient content to copy to the clipboard and immeidately paste to the cursor position.

If fetch is set to true, the flow interprets query as a draft unique identifier. It will retrieve the content of the identified draft, and place it on the clipboard as a transient copy, and then immediately paste to the cursor position..

Variables

Used

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

Variable Description
query * The unique identifier of a Draft, or the content of a draft; as specified by the fetch variable.
fetch When set to true, this will use the query as the UUID of the draft to fetch the content. When set as false (or not set at all), the query will be assumed to be the content of a draft to be copied to the clipboard and immediately pasted.

* These are mandatory for triggering this flow.

Created

The following variables are set-up by the flow.

Variable Description
NotificationTitle The title to be shown in any completion notification.
NotificationMessage The message to be shown in any completion notification.

Termination

Flow

drpaste

Scripting

Sample Code (AppleScript)

tell application id "com.runningwithcrayons.Alfred"
	run trigger "drpaste" in workflow "com.thoughtasylum.doctordrafts" with argument "some unique text in the draft"
end tell

URL

alfred://runtrigger/com.thoughtasylum.doctordrafts/drpaste/?argument=some%20unique%20text%20in%20the%20draft

Notes

  • If fetch is set to true and an invalid UUID is passed in, the clipboard will remain unchanged, and no content will be pasted. No error is reported.