Last active
March 11, 2016 01:33
-
-
Save digiltd/eff52da23a62c998b658 to your computer and use it in GitHub Desktop.
Detect displays with a not very elegant AppleScript macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tell application "System Preferences" | |
| activate | |
| reveal pane "com.apple.preference.displays" | |
| end tell | |
| delay 0.5 | |
| tell application "System Events" | |
| tell process "System Preferences" | |
| try --don't even consider not using a try block! | |
| key down option | |
| delay 0.2 | |
| click button "Detect Displays" of window 1 | |
| delay 0.2 | |
| key up option | |
| on error --logging out is the only other way to clear these | |
| key up option | |
| end try | |
| end tell | |
| end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment