Guest User

Untitled

a guest
May 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. -- Launch "System Preferences", open the "Displays" options and change to the "Display" tab
  2. tell application "System Preferences"
  3. activate
  4. set the current pane to pane id "com.apple.preference.displays"
  5. reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
  6. end tell
  7.  
  8. local index1, index2, index3, indexToUse
  9.  
  10. set index1 to 3
  11. set index2 to 4
  12. set index3 to 5
  13.  
  14. -- Now lets make the necessary changes
  15. tell application "System Events"
  16. delay 0.2
  17. tell window "Built-in Retina Display" of application process "System Preferences" of application "System Events"
  18. delay 0.2
  19. tell radio group 1 of tab group 1
  20. click radio button "Scaled"
  21. end tell
  22. delay 0.2
  23. tell radio group 1 of group 1 of tab group 1
  24. if (value of radio button index1) is true then
  25. set indexToUse to index2
  26. else if (value of radio button index2) is true then
  27. set indexToUse to index3
  28. else if (value of radio button index3) is true then
  29. set indexToUse to index1
  30. else
  31. set indexToUse to index1
  32. end if
  33. click radio button indexToUse
  34. end tell
  35. --get entire contents
  36. end tell
  37. end tell
  38.  
  39. tell application "System Preferences"
  40. quit
  41. end tell
Add Comment
Please, Sign In to add comment