How can I change change screen resolution using AppleScript? If AppleScript can't do it, what about Terminal?

I tried with examples at How to set screen resolution with a keyboard shortcut on Retina MBP?, but they don't work anymore. I'm on MacBookPro Retina.

This is how the script definitively should start:

    tell application "System Preferences"
        reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
    end tell
    tell application "System Events"
        tell application process "System Preferences"
          -- insert magic
        end tell
    end tell

Now I just need to click on "Scaled" and select different display resolutions, but I don't know how these buttons are "called".


Don't know if still works on current versions of OS X, but somebody wrote a command line tool to get and set resolutions a few years ago: https://github.com/jhford/screenresolution

  • thank you! Although it still works, it doesn't work well. 1440x900 look completely different when set using Displays. Im guessing Retinas weren't around when this was created. – sanjihan May 3 '16 at 19:04
  • I wrote a similar lightweight command line tool (installable via Homebrew) that does support retina screens: github.com/jakehilborn/displayplacer – Jake Hilborn Apr 7 '19 at 17:57

We have created a python script, called Display Manager that allows you programmatically set resolution, bit depth, underscan, mirroring, etc.

Give it a try and let us know if you want additional functionality


  • 1
    Worked for me! I created a Workflow using Automator and assigned a keyboard shortcut via System Preferences > Keyboard > Shortcuts. – rinogo Jun 3 '20 at 1:01
  • 1
    (My command for 1920x1080 @60 fps: /path/to/display_manager.py res 1920 1080 60) – rinogo Jun 3 '20 at 1:06

I've included two scripts in this post for making the display resolution higher or lower. Taking it one step further, I also included the process of assigning keyboard shortcuts.

Changing display resolution with AppleScript

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .