Capturing values
Some steps produce a value you can name and reuse. Give it a name in the step’s Save as field, and every later step can read it as {{that-name}}. The built-in tokens are in Tokens.
Steps that save a value
Section titled “Steps that save a value”- Save clipboard as value saves what’s on the clipboard. Its name starts as
clipboard-text. - Ask for input saves what you type. Its name starts as
input. See Ask for input. - Run shell script and Run AppleScript save what the script prints or returns, once you fill in Save output as or Save result as.
Clear the name and nothing is saved; the field says so. Every value a step saves is text, so it inserts exactly as it was captured. A captured 3 still works as a Repeat count.
The chips under a field offer a saved value only where it has certainly been stored by the time that step runs: a step above the capture doesn’t offer it, and neither does one in the other branch of an If. You can still type any name by hand.
Inside a script
Section titled “Inside a script”A script body is code, so tokens are never replaced inside it: {{clipboard}} in a script reaches the shell as those braces, and the editor warns when a script mentions one. The values come as environment variables instead, so what’s on your clipboard can’t become part of the command:
SUPER_CLIPBOARDandSUPER_SELECTION, set only when the script’s text names them.SUPER_<NAME>for every value saved earlier: the name in capitals, with anything but letters and digits as_, sofile-countisSUPER_FILE_COUNT.SUPER_SHORTCUT_ID, the running shortcut’s id.
Each value may be up to 64 KB. A larger clipboard or selection fails the step and says so (read it with pbpaste instead). A shell script’s Send it text (stdin) under More options does take tokens. See Shortcut and script steps.
Rules for names
Section titled “Rules for names”clipboardandselectionare reserved. Naming a capture after one of them throws the captured value away, because the built-in wins. The Save as field says so: rename the capture. A name shaped likedate:…ortime:…is reserved the same way.- A capture named
dateortimereplaces the built-in. After that step,{{date}}types what you captured. The editor points it out;{{date:…}}with a format always reads the clock. - Later captures win. If two steps store into the same name, steps after the second one see the second value.
- A shortcut that runs another shares its values. A value saved by a shortcut this one runs, or by one that runs it, counts.
- A name with
{or}in it can’t be written as a token. The field says so.