Macro state
Passes when a macro or group is enabled, active (able to fire) or running right now.
macro is state
Keyboard Maestro: Macro (Is Enabled, Is Active, Is Executing)
Details #
Looks a macro or a group up by id or name and tests one of three states:
enabled: its own switch is on.active: it can fire now. For a macro that means it is enabled and its group is too; for a group it is the same as enabled.executing: at least one run of the macro, or of any macro in the group, is in progress. The run asking the question counts, so a macro testing itself is always executing.
If nothing has that id or name, every state is false and the trace shows found: false; negate it to test that something is not running. The trace shows the macro's name as macro, found and the state. Reading macro state is harmless, so it happens for real in a dry run too.
Every condition accepts "negate": true, which flips the verdict. The trace records what was compared before the flip, so a negated condition that blocks a macro still shows the real values.
Conditions in an Only if list combine with all: every one must pass, and an empty list always passes. An if step or a repeat loop takes a match of all (default) or any.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
macro | text | Yes | The id or name of a macro or group. Accepts {{ }}. | |
state | one of | Yes | enabled active executing | enabled, active or executing. |
Examples #
- If the macro “Nightly cleanup” is turned on
- Show “Nightly cleanup is on”
- Else
- Show “Nightly cleanup is off or missing”
Gotchas #
It only works while a macro runs. Outside a run the condition fails with a message saying so.
It tests state, it doesn't lock. Two macros can both see the other as not executing and start together; use a Lock or unlock when that matters.