• 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 helper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GUI Scripting helper


  • Subject: GUI Scripting helper
  • From: Alex Zavatone <email@hidden>
  • Date: Tue, 21 Sep 2010 14:46:27 -0500

I've been back in some GUI scripting and getting the proper way to refer to UI elements can be a regular pain in the ass.

I just cooked this up to help myself out. Hopefully, it might help one of you out as well.

Some type of pretty printer function would be nice, but I just copy the output into SubethaEdit and replace this string with a return: ", ".

tell application "System Events"
tell process "Any Application" -- change to the target app's name
set frontmost to true
tell window "Library" -- change to the target window's name


set myElements to every UI element
set myElementNames to the name of every UI element
set myClasses to the class of every UI element
set myActions to the actions of every UI element
set myAttributes to the attributes of every UI element

end tell


log myElements
log myElementNames
log myClasses
log myActions
log myAttributes
end tell
end tell

 _______________________________________________
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 helper
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: InDesign CS4 Fractions Script
  • Next by Date: Re: automatic saving pdf files in pages
  • Previous by thread: Re: InDesign CS4 Fractions Script
  • Next by thread: Re: GUI Scripting helper
  • Index(es):
    • Date
    • Thread