triggerValue
What the trigger handed to the run, such as the typed text or the file path.
Keyboard Maestro: TriggerValue
Details #
Use it anywhere a {{ }} expression is allowed, as {{triggerValue}} in a step's text or as triggerValue inside a longer expression. It also works as a call, triggerValue(). It holds the one most useful piece of the event that started the run. Switchboard takes the first of these that the event has:
a
triggerValuethe event set explicitlyvaluepath(a file trigger)string(what you typed for a typed-string trigger)title(a window title trigger)keys(a hotkey trigger)route(a URL or webhook trigger)
If the event has none of these, as when you run a macro by hand, the result is an empty string.
A run variable with the same name wins. If a step stores something in a variable called triggerValue, {{triggerValue}} reads that variable, not the live value. Name your own variables something else.
Parameters #
Write it as {{triggerValue}} in any text field. A variable of the same name wins.
Examples #
"You typed: " + triggerValueYou typed: ;sig| Sample variable | Value |
|---|---|
triggerValue | ;sig |
- A file is created in ~/Downloads
- Show “New file: {{triggerValue}}”
Gotchas #
A macro's Only if is checked once before any run exists, and there
triggerValueis empty. Test it inside anifstep instead.Triggers that don't hand over a value, such as wake or unlock, leave it empty.