Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Launch "System Preferences", open the "Displays" options and change to the "Display" tab
- tell application "System Preferences"
- activate
- set the current pane to pane id "com.apple.preference.displays"
- reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
- end tell
- local index1, index2, index3, indexToUse
- set index1 to 3
- set index2 to 4
- set index3 to 5
- -- Now lets make the necessary changes
- tell application "System Events"
- delay 0.2
- tell window "Built-in Retina Display" of application process "System Preferences" of application "System Events"
- delay 0.2
- tell radio group 1 of tab group 1
- click radio button "Scaled"
- end tell
- delay 0.2
- tell radio group 1 of group 1 of tab group 1
- if (value of radio button index1) is true then
- set indexToUse to index2
- else if (value of radio button index2) is true then
- set indexToUse to index3
- else if (value of radio button index3) is true then
- set indexToUse to index1
- else
- set indexToUse to index1
- end if
- click radio button indexToUse
- end tell
- --get entire contents
- end tell
- end tell
- tell application "System Preferences"
- quit
- end tell
Add Comment
Please, Sign In to add comment