Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@toidiu
Created May 9, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toidiu/d370a50bc968a4405ff9b1f3af566627 to your computer and use it in GitHub Desktop.
Save toidiu/d370a50bc968a4405ff9b1f3af566627 to your computer and use it in GitHub Desktop.
--This script only works on OS X 10.8; This is due to GUI changes from 10.7 to 10.8
--launches System Preferences to Displays pane
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
delay 1
--Ensures window is on Display tab, not Color tab
click radio button "Display" of tab group 1 of window 1 of process "System Preferences"
--Ensures Resolution preference is "Scaled" to select resolutions
click radio button "Scaled" of radio group 1 of tab group 1 of window 1 of process "System Preferences"
--Sets the resolution to whatever is in row 9 for the primary display; 1280 x 720
click radio button 4 of radio group 1 of group 1 of tab group 1 of window 1 of process "System Preferences"
end tell
--Quits System Preferences
tell application "System Preferences"
quit
end tell
tell application "Script Editor"
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment