Re: Coordinating lists
Re: Coordinating lists
- Subject: Re: Coordinating lists
- From: Steven Angier <email@hidden>
- Date: Wed, 03 Apr 2002 08:23:27 +1000
On 3/4/02 5:17 AM, "Fraser" <email@hidden> wrote:
>
I need to get an item's position and value based on a choice from another
>
list. The values in lines 4 and 5 are placeholders. Any pointers?
The Macscript.com Library contains functions which may help you, namely
"GetOffsetInList()". Using it, you could use:
set list1 to {"Apple", "Banana", "Grape", "Orange"}
set list2 to {34, 56, 56, 8}
set theItem to item 1 of (choose from list list1)
--use the Library function to find the index of what the user selected
set theOffset to GetOffsetInList(theItem, list1)
--now lookup the corresponding item in the second list
return item theOffset of list2
A 30-day demo of the Macscript.com Library is available from our website
<
http://www.macsccript.com>. You can find an example of this technique in
the List Function Examples folder in the Library package
Steven Angier
Macscript.com
_______________________________________________
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.