• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
GUI Scripting to click on "Detect Displays"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GUI Scripting to click on "Detect Displays"


  • Subject: GUI Scripting to click on "Detect Displays"
  • From: Gil Dawson <email@hidden>
  • Date: Sat, 4 Aug 2007 11:09:17 -0700

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:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: GUI Scripting to click on "Detect Displays"
      • From: Norman Cohen <email@hidden>
  • Prev by Date: Accessing the Accessibility Inspector
  • Next by Date: Re: Help with find text command
  • Previous by thread: Re: Accessing the Accessibility Inspector
  • Next by thread: Re: GUI Scripting to click on "Detect Displays"
  • Index(es):
    • Date
    • Thread