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

Re: GUI Scripting helper


  • Subject: Re: GUI Scripting helper
  • From: Bill Cheeseman <email@hidden>
  • Date: Tue, 21 Sep 2010 17:12:33 -0400


On Sep 21, 2010, at 3:46 PM, Alex Zavatone wrote:

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
....

That's exactly right: you can get most of the relevant information about writing GUI Scripting scripts by using GUI Scripting itself. But you'll find it even more helpful to use Apple's free UIElementInspector or my UI Browser <http://pfiddlesoft.com/uibrowser>. Among other things, we give you the indexes of particular UI elements at a glance, which are harder to come by using GUI Scripting.

--

Bill Cheeseman - email@hidden

 _______________________________________________
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: Alex Zavatone <email@hidden>
References: 
 >GUI Scripting helper (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: automatic saving pdf files in pages
  • Next by Date: Re: GUI Scripting helper
  • Previous by thread: GUI Scripting helper
  • Next by thread: Re: GUI Scripting helper
  • Index(es):
    • Date
    • Thread