Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Detect Displays Applescript Trigger
# This is an Applescript to trigger the Detect Displays functionality quickly on OS X
# 1. save this to a file with a `.scpt` extension
# 2. make sure that the Displays menu is set to display in the OS X menu bar
# 3. use your favorite quick access app (Spotlight, LaunchBar, Quicksilver, etc...) to call the script
# See: for a
# caveat if you have trouble and are using AppleScript when you have Adobe applications installed
to click_menu_extra at menu_list
tell application "System Events" to tell process "SystemUIServer"'s menu bar 1
click (first menu bar item whose value of attributes contains menu_list's beginning)
repeat with item_name in rest of menu_list
click (first menu item of result's menu 1 whose name is item_name)
delay 0.5
end repeat
end tell
end click_menu_extra
click_menu_extra at {"displays", "Detect Displays"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.