Browse the docs

Stop macro

Ends this macro's run right now and marks it cancelled.

Stop the macro

Keyboard Maestro: Cancel, CancelJustThisMacro, CancelThisMacro, CancelAllMacros

Details #

Stops the run at this step. Nothing after it runs, in loops or in groups. The run is marked cancelled in the Trace, not failed, so it raises no error.

Use it behind an If when there is nothing to do: the wrong app is in front, a file is missing, the input is empty.

When this macro was started by Run macro, only this macro stops. The macro that called it carries on.

Stop unless there's work
Do
  1. Set pending to 0
  2. If pending is 0
  3. Stop the macro
  4. Show “Working…”
Open in Switchboard to try it

Parameters #

This step takes no parameters.

Examples #

Bail out of a loop and the macro
Do
  1. Repeat 5 times
  2. If i is above 2
  3. Stop the macro
Open in Switchboard to try it

Gotchas #

  • To leave only a loop, use Break out of repeat. To end the macro with a result, use Return a value.

  • It stops this run only. Other runs of the same macro are not touched.

See also #

Return a value, Break out of repeat, If