Run Shortcut
Runs a shortcut from the Shortcuts app, optionally passing it input and capturing its text output.
Run the shortcut name
Keyboard Maestro: ExecuteShortcut
Details #
Runs the named shortcut with the shortcuts command-line tool and waits for it to finish. If you give input, it is written to a temporary file and handed to the shortcut as its input: plain text for a string, JSON for anything else. The shortcut's output is read back as plain text and becomes the step's output ({"output": "..."}), with trailing newlines removed. If into is set, the variable gets the text.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
name | text | Yes | Required. The shortcut's name exactly as it appears in the Shortcuts app. | |
input | any value | Text or data to give the shortcut. Leave it out, or leave it empty, to run with no input. | ||
into | text | The variable that receives the shortcut's text output. | ||
sample | any value | What into holds during a dry run. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
- Run shortcut “Get Weather Summary”
- Show “{{summary}}” for 4 s
Gotchas #
Dry run. The shortcut does not run;
intogetssampleor an empty string.Timeout. The step is cancelled after 10 s unless you set
timeouton the step. Shortcuts that show dialogs or wait on the network often need more.A name that matches no shortcut fails the step with
shortcut "name" failedand the tool's message.Output is collected as plain text. A shortcut that returns a file or an image gives you its text form, or nothing.
A shortcut that asks you a question waits for you in its own window.