Window moves or resizes
Runs the macro when the front window moves or changes size.
The front window moves or resizes
Keyboard Maestro: FocusedWindow WindowMoves, FocusedWindow WindowResizes
Details #
Watches the front window of the front app and fires when its frame changes. event says which change you want:
moves fires when the window's position changes by more than 1 point and its size does not.
resizes fires when its width or height changes by more than 1 point. A resize that also moves the window counts as a resize.
Switchboard looks at the front window twice a second, so a window you are dragging fires the macro repeatedly while it moves, about every half second. Leave a window alone and nothing fires.
Switching to another app is not a move. The first reading after the front app changes only sets the starting point.
app limits it to one app, by bundle identifier (com.apple.finder, any case). Left out, any front app matches.
{{triggerValue}} is empty for this trigger.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
event | one of | Yes | moves resizes | moves or resizes. If left out, moves is used. |
app | text | A bundle identifier. Only that app's window counts. |
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 front window is resized in Finder
- Show “Finder window resized”
Gotchas #
It watches only the front window of the front app. A window that moves in the background does not fire.
Because it fires on every poll in which the window changed, a long drag runs the macro many times. Use a short macro, or add an Only if condition.
A macro that moves or resizes the window itself will fire the trigger again.