How to get applescript or automator to ask system to "detect displays"
Macbook 2.4 GHz, Mac OS X (10.5.4)
Macbook 2.4 GHz, Mac OS X (10.5.4)
Sorry I'm late, but this page was the only Google find on "script detect displays"
when I checked on June 26, 2011. The script commands worked immediately for
me and I offer V.K. belated thanks if he/she is still around for having solved this
longstanding problem for me. I had written a script earlier trying to do this, but it
didn't work reliably so I gave up on trying to use it.
If jockebq is by chance still around, I would recommend that he/she try doing as
I did and use a more simple version of the script, namely:
tell application "System Events" to tell the front menu bar of process "SystemUIServer"
tell (first menu bar item whose value of attributes contains "displays")
click
tell 1st menu item of front menu
click
end tell
end tell
end tell
I have this saved as a normal .scpt script and assigned to ctrl-opt-shift-d
in QuicKeys. It works every time.
Roy McCoy
Rotterdam, NL
Roy's Script works like a charm in Lion as well. I opened up appleScript, copy & paste, did a test run, and saved it as an Application. Now when I plug in my janky work monitor and lose my main screen, I just have to hit command+space , type detect and hit enter.
If anyone has any issues with the script, make sure you have assistive devices turned on, and displays in your menu bar (both can be set in system preferences).
How to get applescript or automator to ask system to "detect displays"