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 #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
app | text | Bundle id of the app to watch. Any app when left out. | ||
mode | one of | equals contains regex | equals, contains or regex. Default regex. | |
pattern | text | Text 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 #
- The title of Safari changes
- Show “{{triggerValue}}”
Gotchas #
equalsandcontainsare 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.