Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GUI Scripting to click on "Detect Displays"



Hi--

When I plug my 12" PowerbookG4 into a large screen, Tiger reconfigures the displays so that both screens are useable. If the Powerbook is closed when I plug it in, however, only the large screen is usable, even if I later open the Powerbook. I have found that I can activate the second screen simply by clicking on the "Detect Displays" button in the "Displays" tab of the "Displays" pane of System Preferences.

I thought I'd share an Applescript to do this that I made out of parts I found in these archives:

tell application "System Preferences"
activate
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
tell application "System Events"
tell application process "System Preferences"
tell window 1
tell group 1 of tab group 1
click button "Detect Displays"
end tell
end tell
end tell
end tell
quit
end tell


Thanks for your collective help.  You sure make it easy.

--Gil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.