Browse the docs

Set screen resolution

Changes a screen's resolution to a width and height that the display offers.

Set the resolution to width by height

Keyboard Maestro: SetScreenResolution

Details #

Sets the resolution of one screen to width by height, in points, the sizes that appear in Displays settings. screen counts the active displays from 1. The default is screen 1.

The step looks through the modes that display offers for one with exactly that size. If several match, it takes the sharpest. The change is made permanent, so it stays after the macro ends and after a restart, until you change it back.

Width and height can be numbers or text, so they can come from variables. The step has no output. Its note says, for example, "set screen 1 to 1440x900".

Parameters #

ParameterTypeRequiredValuesWhat it does
heightany valueThe height in points. Required, and more than 0.
screenany valueWhich display, counting from 1. The default is 1.
widthany valueThe width in points. Required, and more than 0.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Use Try it (a dry run) to see the step. A real run changes your display, so pick a size your screen offers first:

Set screen 1 to 1440 x 900 (dry-run only; really changes the display)
Do
  1. Set the screen to 1440×900
  2. Show “Resolution changed”
Open in Switchboard to try it

Gotchas #

  • Missing width or height fails with "needs a width and a height".

  • A screen that is not connected fails with "screen N isn't connected" and says how many displays are active.

  • A size the display does not offer fails with "screen N can't run at WxH; it offers …" and lists the sizes it does offer.

  • If macOS refuses the change, the step fails with "macOS refused the resolution change".

  • In a dry run the step is simulated.

See also #

Change screen brightness, Set desktop picture