• 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
Selecting From A List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Selecting From A List


  • Subject: Selecting From A List
  • From: Jim Brandt <email@hidden>
  • Date: Sat, 28 Apr 2012 13:47:17 -0500

I have a need to select multiple items from a list (sometimes lists of hundreds of items).

After getting the selection, I need the index into the list of each item selected.
Is there an easy way to do this?

An example:

set ListOfSelections to {"String 1", "String 2", "String 3", ..., "String n"}

set r to choose from list ListOfSelections with prompt "Pick one or more:" with multiple selections allowed

Assuming I select "String 2", "String 3" and "String n", r contains a list {"String 2", "String 3", "String n"}

I need to know that the first string of the selection is item 2 of the original list,
the second string of the selection is item 3 of the original list and the third
string of the selection is item n of the original list. Is there a way to return the
item number of the original list instead of the selections themselves, or do I
now need to search the original list to pick out the positions?

TIA,

Jim Brandt
 _______________________________________________
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: Selecting From A List
      • From: Shane Stanley <email@hidden>
    • Re: Selecting From A List
      • From: Deivy Petrescu <email@hidden>
    • Re: Selecting From A List
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: Mailboxes in Mail & Applescript
  • Next by Date: Re: AppleScript-Users Digest, Vol 9, Issue 188
  • Previous by thread: Safari auto pause and resume script
  • Next by thread: Re: Selecting From A List
  • Index(es):
    • Date
    • Thread