Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- OS X 10.9.2
- --this script (c) Phil Stokes / Applehelpwriter 2014
- --applehelpwriter.com
- (*
- This script automates clicking the 'Detect Displays' button in System Preferences
- You will need to allow access to Assistive Devices in Sys Prefs > Security settings for it to work
- Very useful combined with a hotkey to quickly get your external monitor resolution correct
- *)
- try
- --if sys prefs is already open, lets quit it first*
- tell application "System Preferences" to quit
- end try
- delay 1
- tell application "System Preferences"
- activate
- reveal pane "com.apple.preference.displays"
- end tell
- tell application "System Events"
- tell process "System Preferences"
- set frontmost to true
- try
- key down option
- delay 0.2
- click button "Detect Displays" of window 1
- delay 0.2
- key up option
- on error
- key up option
- end try
- end tell
- end tell
- tell application "System Preferences" to quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement