Re: Determining item number matching "x" in a list
Re: Determining item number matching "x" in a list
- Subject: Re: Determining item number matching "x" in a list
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 11 Mar 2003 12:51:11 -0800
On 3/11/03 12:10 PM, "Steve Cunningham" <email@hidden> wrote:
>
I wonder if there is some trivial way to do this without writing a repeat
>
loop that cycles through every value of the list looking for a match:
>
>
I have a list, theList = {"a","b","c","etc"} and I want to know the item
>
number of the item that matches a variable x. I need something like
>
>
"get the item number of x in theList"
>
>
which returns a if x = "a", 2 if x = "b" etc.
>
>
Did I miss a page in the manual :-)
No. They have never (yet) implemented 'whose' clauses for AppleScript lists
and records, as applications can implement for application objects. It's
been probably the major enhancement request for over 10 years. Maybe
AppleScript 2.0 will have it. We can hope. In the meantime, you have to use
a repeat loop.
--
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.