Shortcuts Actions

iPhone and iPad Only

Apple’s Shortcuts app is only available on iOS and iPadOS. These features are not available on the Mac version of Drafts.

Drafts offers an extensive array of actions to integration with Apple’s Shortcuts app on iOS and iPadOS. Most of these require the version of Shortcuts included with iOS/iPadOS 13 or greater.

NOTE: Some shortcuts actions require a Pro subscription. PRO

Table of Contents

  1. iPhone and iPad Only
  2. Parameter and Result Objects
    1. Draft
    2. Workspace
    3. Action
  3. Working with Drafts
    1. Open Draft
    2. View Draft
    3. Create Draft
    4. Create Draft with Clipboard
    5. Create Draft with Dictation
    6. Get Draft
    7. Get Draft by UUID
    8. Update Draft
    9. File Draft
  4. Querying Drafts
    1. Search Drafts
    2. Get Drafts from Workspace
  5. Running Actions
    1. Run Action with Text
    2. Run Action on Draft
  6. Other
    1. Apply Workspace
    2. Markdown to HTML

Parameter and Result Objects

Many Shortcuts actions require parameters to specify what objects in Drafts you want to make changes to, or retrieve information about. These parameters take the form of the following objects in Shortcuts:

Draft

Most Drafts’ Shortcut actions return a Draft object, or in the case of query actions, arrays of Draft objects. Each of these objects contains the the following values about the draft:

  • Draft: The primary identifier for the draft. This can be used in subsequent Shortcut actions to identify the draft.
  • UUID string: The UUID of the draft.
  • Content string: The full text of the draft.
  • Link string: A permalink to the draft, using the drafts5://open URL action.
  • Title string: The first line of the draft.
  • Tags array of strings: Tags assigned to the draft.
  • Flagged boolean: Flagged status of the draft.
  • Folder: Folder the draft is currently located in. Possible values: Inbox, Archive or Trash.
  • Syntax Definition: Syntax highlighting mode assigned to the draft.
  • Creation Date date: Timestamp of draft creation.
  • Creation Location location: Location the draft was created.
  • Modification Date date: Timestamp of draft’s last modification.
  • Modification Location location: Location the draft was last modified.

Workspace

  • Workspace: The primary identifier for the workspace. This can be used in subsequent Shortcut actions to identify the draft.
  • Name: The name assigned to the Workspace.

Action

  • Action: The primary identifier for the workspace. This can be used in subsequent Shortcut actions to identify the draft.
  • Name: The name assigned to the Workspace.

###

Working with Drafts

Open Draft

Open Draft to a specific draft.

  • Parameters
    • Draft: A valid draft

View Draft

Open a preview of the content of a draft in Siri. Displays without opening Drafts.

  • Parameters
    • Draft: A valid draft

Create Draft

Create a new draft with the parameters provided. Does not require opening Drafts.

  • Parameters
    • Content string: Content of the draft.
    • Tags array of strings: Tags to assign.
    • Folder: The folder to place the draft.
    • Flagged Status: Whether to make the draft flagged.
    • Syntax Definition: Syntax highlighting mode to assign.
  • Returns
    • Draft: Dictionary containing information about the draft created.

Create Draft with Clipboard

Create a new draft with the current contents of the system clipboard. No parameters are supported.


Create Draft with Dictation

Launch Drafts to dictate a new draft.

  • Parameters
    • Locale string: Locale identifier for the preferred language/country for dictation in the standard format such as en-US (English/US), es-MX (Spanish/Mexico), it-IT (Italian/Itally), etc.

Get Draft

Get details about an existing draft.

  • Parameters
    • Draft: A valid draft
  • Returns
    • Draft: Dictionary containing information about the draft affected.

Get Draft by UUID

Get details about an existing draft based on it’s UUID.

  • Parameters
    • UUID: A valid draft UUID.
  • Returns
    • Draft: Dictionary containing information about the draft affected.

Update Draft

Update content or other values of an existing draft.

  • Parameters
    • Draft: A valid draft
    • Content string: Text to prepend to the beginning.
    • Content Update Type:
      • Replace: Replace exiting content of the draft with new content.
      • Prepend: Prepend new content to the beginning of the draft.
      • Append: Append new content to the end of the draft.
    • Tags array of strings: Tags to assign.
    • Folder: The folder to place the draft.
    • Flagged Status: Whether to make the draft flagged.
    • Syntax Definition: Syntax highlighting mode to assign.
  • Returns
    • Draft: Dictionary containing information about the draft affected.

File Draft

Update folder or other values of an existing draft without affecting content.

  • Parameters
    • Draft: A valid draft
    • Tags array of strings: Tags to assign.
    • Folder: The folder to place the draft.
    • Flagged Status: Whether to make the draft flagged.
  • Returns
    • Draft: Dictionary containing information about the draft affected.

Querying Drafts

Search Drafts

Query for drafts matching the specified values.

  • Parameters
    • Search string: Full text search string.
    • Folder: Limit results to only drafts in the specified folder. Values: Inbox, Archive, Trash, All.
    • Tag filter string: Tag filter string specifing tags to include or omit. Should be comma-separate list of tag values, using ! before tags to omit.
    • Flag status: Limit result to only drafts with specified flag status. Options: Flagged, Unflagged, Any.
    • Sort Order: Order to sort results.
    • Sort Descending: If yes, sort in reverse order.
    • Limit: Maximum number of matching results to return.
  • Returns
    • Array of Drafts: Array of Draft Details dictionaries containing information about the matching drafts.

Get Drafts from Workspace

Query for drafts in a specified workspace.

  • Parameters
    • Workspace Identifier: Identifier of an existing workspace in Drafts.
    • Folder: Limit results to only drafts in the specified folder. Values: Inbox, Archive, Trash, All.
  • Returns
    • Array of Drafts: Array of Draft Details dictionaries containing information about the matching drafts.

Running Actions

Run Action with Text

Open Drafts and run an action on the specified text.

  • Parameters
    • Action: A valid action.
    • Input string: Text to run the action on.

Run Action on Draft

Open Drafts and run an action on the specified existing draft.

  • Parameters
    • Action: A valid action.
    • Draft: A valid draft

Other

Apply Workspace

Open Drafts and load a specific workspace.

  • Parameters
    • Workspace: An existing workspace.

Markdown to HTML

Convert Markdown text to HTML using Drafts built-in Markdown options.

  • Parameters
    • Content: The Markdown text to convert.
    • Markdown Parser: Choose whether to use MultiMarkdown or GitHub Markdown.
  • Returns
    • Text: The HTML output returned by the Markdown Parser.