2

I use different screen resolutions based on the activity I'm doing during the day.
For example when I'm coding I prefer to have more space available.
Is it possible to associate a keyboard shortcut to change the scaled display resolution ?
(see the attached screenshot) enter image description here

3

Yes you totally can achieve this without running additional apps. On my system I created two different scripts. One script for adjusting the display resolution higher and one adjusting display resolution lower. On my system I just enabled both scripts as dictation commands but if you create a new Service through Automator, you can assign keyboard shortcuts to those services..

First, here are the two scripts I started with.

This one is for making the display resolution higher: if my display resolution is already at the default position

enter image description here

tell application "System Preferences"
    reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
    click radio button "Scaled" of radio group 1 of tab group 1
    click radio button 4 of radio group 1 of group 1 of tab group 1
end tell
quit application "System Preferences"

Running that script will result in this:

enter image description here

This next script is for making the display resolution lower: if my display resolution is not set at the default setting

tell application "System Preferences"
    reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
    click radio button "Scaled" of radio group 1 of tab group 1
    click radio button 3 of radio group 1 of group 1 of tab group 1
end tell
quit application "System Preferences"

Once I made sure both scripts work correctly, I then opened up Automator and created a new service for the display resolution higher and added the appropriate script as shown in the following image. I saved this file as rez_higher.workflow

enter image description here

From here, I opened up system preferences/keyboard/shortcuts/services. I located that new service I created and assigned it a keyboard shortcut

enter image description here

After this, just follow the same procedures to create a new workflow and service for the display resolution lower

  • 1
    Thanks, this worked as I wanted. I've also found a workflow where you can toggle the resolution change in the same script here – david-e Dec 3 '16 at 6:00
0

You can use this app called SwitcherResX (http://www.madrau.com/srx_download/download.html) where they have option to change resolution with Keyboard shortcut or based on application you use. They have a trial to try.enter image description here

  • Thanks. I was looking for something at system level without running additional apps. But I will keep your suggestion in consideration as alternative solution! – david-e Dec 1 '16 at 18:26
0

I wrote the free command line tool displayplacer to change resolutions/rotations for single or multi-monitor desktops. You can trigger a "profile" (example below) via a keyboard shortcut with Automator like wch1zpink explained, BetterTouchTool, etc.

displayplacer 'id:69731906 res:1440x900 scaling:on origin:(0,0) degree:0'

You must log in to answer this question.

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