Browse the docs

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 #

ParameterTypeRequiredValuesWhat it does
eventone ofYesmoves resizesmoves or resizes. If left out, moves is used.
apptextA 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 #

Flash a note when a Finder window is resized
When
  1. The front window is resized in Finder
Do
  1. Show “Finder window resized”
Open in Switchboard to try it

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.

See also #

Window title change, Application event