Browse the docs

Front app

Passes when the app in front has the given bundle identifier.

app is in front

Keyboard Maestro: Application (Active, NotActive)

Details #

Compares the bundle identifier of the frontmost app with bundleId, ignoring case. com.apple.finder is Finder, com.apple.Safari is Safari. The identifier must match exactly; a name like Finder does not.

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.

When the macro doesn't run, the Not fired report in ⌘2 Activity names this condition and shows frontApp (what was in front) and expected (what you asked for).

Parameters #

ParameterTypeRequiredValuesWhat it does
bundleIdtextYesThe app's bundle identifier. Text from the token {{frontApp}} works too.

Examples #

Only in Finder
When
  1. Press ⌃⌥J
Only if
  1. If the front app is Finder
Do
  1. Show “In Finder”
Open in Switchboard to try it
Anywhere except Terminal
When
  1. Press ⌃⌥J
Only if
  1. If the front app isn't Terminal
Do
  1. Show “Not in Terminal”
Open in Switchboard to try it

Gotchas #

  • A macro run by hand (from the Palette, the CLI or the app) or by another macro's runMacro step skips the Only if list and runs anyway; the trace still records the verdict and says it was skipped. Only triggers are gated.

See also #