Browse the docs

Window title change

Runs the macro when the title of the front window changes, optionally for one app or a matching title.

The title of app changes

Keyboard Maestro: FocussedWindow

Details #

Switchboard reads the front window's title about every three quarters of a second and fires when the app or the title is different from the last reading. The first reading only sets a baseline. Optional app (a bundle id) limits it to one app, and pattern limits it to titles that match, using mode: equals, contains or regex (the default, a regular expression that may match anywhere in the title). Leave pattern out to fire on every title change.

{{triggerValue}} is the new title.

Permission. Needs Accessibility. Without it the title is always empty and nothing changes.

Secure input does not affect this trigger.

Parameters #

ParameterTypeRequiredValuesWhat it does
apptextBundle id of the app to watch. Any app when left out.
modeone ofequals contains regexequals, contains or regex. Default regex.
patterntextText or regular expression the title must match.

Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.

Examples #

Tell me when a pull request opens
When
  1. The title of Safari changes
Do
  1. Show “{{triggerValue}}”
Open in Switchboard to try it

Gotchas #

  • equals and contains are case sensitive.

  • Switching to another app also changes the reading, and counts as a title change if its title matches.

  • Not fired reasons: disabled, groupOff, scope, paused, conditionFalse.

See also #

Application event, Triggers