Browse the docs

Return a value

Ends the macro successfully and hands a value back to whoever ran it.

Return value

Keyboard Maestro: Return

Details #

Ends the run as succeeded. Nothing after it runs. The value becomes the run's result. It is shown in the Trace, returned by the API and CLI, and delivered to a calling macro through Run macro (its into variable).

value may be any text, number, list or record, and may use {{ }}. A value that is exactly one {{ expression }} keeps its type. Leave it out to return nothing. If the macro declares what it gives back, a value of another type fails the run (see Functions).

Return a computed value
Do
  1. Set price to 20
  2. Return “{{ price * 1.2 }}”
Open in Switchboard to try it

Parameters #

ParameterTypeRequiredValuesWhat it does
valueany valueWhat to return. Optional.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Return early from a branch
Do
  1. If input is empty
  2. Return “nothing to do”
  3. Show “Got {{ input }}”
Open in Switchboard to try it

Gotchas #

See also #

Run macro, Stop macro, Break out of repeat