actions:Redirect_Control_Flow
Various actions can stop or redirect control flow in the macro. They allow you to cancel this or other macros, or redirect control flow in or out of loops.
Available options are:
- Cancel All Macros — Cancel all macros that Keyboard Maestro Engine is currently executing.
- Cancel All Other Macros — Cancel all macros except this macro instance.
- Cancel This Macro — Cancel this macro and any macros that executed this macro.
- Cancel Just This Macro — Cancel just this macro, continue executing the macro that executed this macro (use Return from Subroutine for macros executed by Execute a Subroutine).
- Cancel a Specific Macro (v9.0+) — Cancels a specific macro instance (from the %ExecutingInstance% or %ExecutingInstances% tokens).
- Forum example: How To Stop a Specific Instance of a Running Macro
- Note that the empty string, or the string “THIS” will cancel the currently executing macro.
- Retry This Loop — Skip to the start of this loop and continue executing.
- Continue Loop — Skip to the end of this loop and continue executing, possibly looping.
- Break From Loop — Cancel execution of the current loop, continue executing after the loop
Whichever action you choose you can still select one of the others from the pop-up menu.
For these purposes, any of the loop actions (For Each, Repeat, Until, While) are considered to be loops. Group is not considered to be a loop (use a Repeat 1 Time if you want to be able to Continue or Retry or Break from a single list of actions that is otherwise executed once).
The behaviour of the Retry, Continue, or Break From Loop actions is undefined if they are not within a loop and is subject to change. Currently the surrounding macro itself is considered a loop.
See Also
Actions
Tokens
Topics
Forum
actions/Redirect_Control_Flow.txt · Last modified: by peternlewis
