• 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: Scripting system preferences in OS X 10.2.3 (Christian Boyce)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting system preferences in OS X 10.2.3 (Christian Boyce)


  • Subject: Re: Scripting system preferences in OS X 10.2.3 (Christian Boyce)
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 31 Dec 2002 00:43:05 -0800

On 12/31/02 12:18 AM, "Christian Boyce" <email@hidden> wrote:

> Regarding the GUI stuff, how does one figure out the index numbers for
> buttons, pop-ups, etc.? How do I know that I'm trying to click button
> 3, say, and not button 4?

I would say it's worth a try getting
name of every button of someWindow

Chances are that (every button of someWindow) will give you the list in
index-order (button 1, button 2, button 3... etc.) , so (name of every
button of someWindow) will be in the same order. Now you can associate index
numbers with names:

set nameIndexList to {}
set buttonNames to name of every button of someWindow
repeat with i from 1 to (count buttonNames}
set theName to item i of buttonNames
set end of nameIndexList to {name:theName, index:i}
end repeat

Or if you're just trying to find the index of a particular button whose
name you know in your own localization:


set buttonNames to name of every button of someWindow
set theName to "whatever"
set theIndex to my CollectUniqueItemIndex(buttonNames, theName)


to CollectUniqueItemIndex(theList, theItem)

set theIndex to 0
repeat with i from 1 to (count theList)
set aListMember to item i of theList
if aListMember = theItem then
set theIndex to i
exit repeat
end if
end repeat

return theIndex

end CollectUniqueItemIndex


--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Scripting system preferences in OS X 10.2.3 (Christian Boyce) (From: Christian Boyce <email@hidden>)

  • Prev by Date: Re: Question regarding errors
  • Next by Date: Re: Help with Quark 5.0
  • Previous by thread: Re: Scripting system preferences in OS X 10.2.3 (Christian Boyce)
  • Next by thread: Re: Scripting system preferences in OS X 10.2.3 (Christian Boyce)
  • Index(es):
    • Date
    • Thread