Raw Action

You can write a raw definition of an action not defined inside Cherri, in Cherri.

Defining an action

Provide a string of the action WFWorkflowActionIdentifier. Then, optionally provide a dictionary for the WFWorkflowActionParameters.

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 how third-party actions and entire libraries could be written in Cherri, but most importantly, how any actions not implemented in Cherri can be used.

However, an alternative called action definitons is upcoming in a future release which create reusable action definitions.

Variable Values

Future Release

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 $.

action saveFile(variable file) {
    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.