Skip to content

Resize and Reposition Window

Two paired actions let a macro change the frontmost window – its size with Resize Window and its position with Reposition Window. Both support absolute and relative values.

In the + Add Action menu, under Environment:

  • Resize Window – Set window size.
  • Reposition Window – Move window.

Both apply to whichever window is currently frontmost at the moment the action runs.

OptionWhat it doesDefault
WidthThe width to set, in pixels. Fixed number or number expression.–
HeightThe height to set, in pixels. Fixed number or number expression.–
ModeAbsolute sets the window to exactly Width × Height. Relative adds Width to the current width and Height to the current height (use negative numbers to shrink).Absolute
OptionWhat it doesDefault
XThe X coordinate to move the window’s top-left corner to. Fixed number or number expression.–
YThe Y coordinate to move the window’s top-left corner to. Fixed number or number expression.–
ModeAbsolute moves the window so its top-left is at (X, Y). Relative offsets the window’s current top-left by (X, Y) – use negative values to move left or up.Absolute
  1. Click + Add Action → Resize Window or + Add Action → Reposition Window.
  2. Enter fixed numbers or number expressions for the values.
  3. Tick Relative to add the values to the window’s current size or position instead of replacing them.
  4. Save.
  • Both actions target the frontmost window. If the wrong window is in front when the action runs, the wrong window gets moved or resized. Place a Window Anchor or click before the action to guarantee focus.
  • If ClicKey itself is frontmost, the action is skipped. When the macro never brought another app to the front, the “frontmost window” would be ClicKey’s own editor window – resizing it mid-run is never what a macro means, so the action does nothing, a warning is written to the playback log (“Resize Window skipped – no other app’s window was frontmost.”), and playback continues normally.
  • Coordinates are in macOS screen space. (0, 0) is the top-left of the primary display. Multi-monitor layouts extend the space – negative values can put a window on a display to the left of the primary one.
  • Some apps refuse to resize below a minimum or above a maximum. macOS clamps the request silently; the action doesn’t error, the window just doesn’t reach the requested size.
  • A Full Screen window ignores resize and reposition requests entirely. macOS doesn’t allow apps to move it. Exit full screen first if you need to script around one.
  • Relative mode is calculated at run time against the live window position, not when the action was saved. This is what makes it useful – but it also means the result depends on where the window happens to be sitting.
  • Expression fields resolve at run time. If Width, Height, X, or Y reference variables, the current values are used when the action runs.
  • There’s no per-action way to target a specific window by title. The actions always act on the frontmost. To target a different window, bring it to the front first (a click on it, or a Window Anchor that resolves it).
  • Window manager apps and tiling utilities can fight with these actions. If a window snaps back after resize, suspect an external window manager.
  • These actions require Accessibility permission, like the rest of ClicKey. They don’t need Screen Recording.
  • Open Application – launch an app and optionally set its initial window size and position in one step.
  • Window Anchors – what tells playback which window each click belongs to.
  • Shift Coordinates – offset the coordinates a macro acts on without moving the window itself. It deliberately leaves window actions alone.
  • The Pre-Playback Window Check – the dialog that lets you resize the picked replacement window automatically.