Skip to content

How to set a window to an exact size and position on a Mac

Make a window exactly 1280 by 800 for a screenshot, a recording or a test. The built in presets, a one line script, and how to give it a keyboard shortcut.

Guide · Updated 22 October 2026

Does macOS have preset window sizes?

Only relative ones. Window, Move & Resize offers halves, quarters, fill and centre, which depend on the screen. For an exact number of points you need a script.

How do I set an exact size with a script?

This sets the front window of the front app to 1280 by 800 points, with its top left corner at 100, 60:

osascript -e 'tell application "System Events"' -e 'tell (first process whose frontmost is true)' -e 'set position of window 1 to {100, 60}' -e 'set size of window 1 to {1280, 800}' -e 'end tell' -e 'end tell'

The first time, macOS asks to let the app running it, such as Terminal, control your computer. Allow it in System Settings, Privacy & Security, Accessibility.

How do I run it with a key?

  1. Make a new Shortcut with the Run AppleScript action and paste the script below in place of its sample text.
  2. Give the Shortcut a keyboard shortcut. See run a Shortcut with a key.
  3. Switch to any window and press the key.
tell application "System Events"
  tell (first process whose frontmost is true)
    set position of window 1 to {100, 60}
    set size of window 1 to {1280, 800}
  end tell
end tell

Why does a window not reach the size I set?

Apps can set a minimum or maximum size, and some fixed size windows cannot be resized at all. A window manager may also move it straight back to its place.

Finder only: Finder window size. Recording at that size: record one window. Resizing by keyboard: resize windows with the keyboard.

Questions

How do I resize a window to an exact size on a Mac?

Use an AppleScript through System Events that sets the size of the front window, for example to 1280 by 800.

Can I save window sizes on a Mac?

Not built in. Save the script as a Shortcut with a key.

Why won't a window resize to the size I set?

The app may limit its window size, or the window may be fixed size.