Raw Actions

You can write a singular definition of an action with custom parameters not defined inside Cherri, in Cherri.

Table of contents

  1. Defining an action
  2. Parsing Shortcut Data
  3. Variable Values

Defining an action

Actions are primarily composed of an identifier and, optionally, parameters. To add an action to your Shortcut raw, provide a string of the action WFWorkflowActionIdentifier. Then, optionally provide a dictionary for each of the required WFWorkflowActionParameters of the action.

rawAction("is.workflow.actions.alert", {
     "WFAlertActionMessage": "Hello, world!",
     "WFAlertActionCancelButtonShown": false
})

This defines an alert action with the message Hello World!. This action is already defined in Cherri using the alert() action. Still, this example demonstrates a simple way actions not implemented in Cherri can be used.

However, there is an alternative called action definitions, which creates reusable action definitions in the same way as the standard actions.

Parsing Shortcut Data

To find the identifier and parameters for an action from a Shortcut not implemented in Cherri, see parsing out action data from a raw Shortcut.

Variable Values

To use a variable value for a parameter that only accepts a variable value, prepend an inline variable reference’s brackets in a string value with the character $.

@file = nil
rawAction("is.workflow.actions.documentpicker.save", {
     "WFInput": "${@file}"
})

Again, just like with the alert() action, there is already a saveFile() action; this is only an example.

Only a single variable is allowed; if this is not detected, the compiler treats the value as a string with inline variable references.


Copyright ©. Distributed under the GPL-2.0 License. Siri Shortcuts and Mac are registered trademarks of Apple Inc. Apple is not involved in this project in any way. Do not contact Apple Support unless you are having an issue with the Shortcuts app itself.