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

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.

References: 
 >Coordinating lists (From: Fraser <email@hidden>)

  • Prev by Date: Vanilla random number generator to applemods (was Re: Random Numbers...)
  • Next by Date: Re: Shell script date & time coercions...
  • Previous by thread: Big Slowdown - CarbonLib 1.5 to blame?
  • Next by thread: Re: Coordinating lists
  • Index(es):
    • Date
    • Thread