• 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: Get Number of Choose From List?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get Number of Choose From List?


  • Subject: Re: Get Number of Choose From List?
  • From: John Delacour <email@hidden>
  • Date: Sun, 20 Jul 2003 13:10:21 +0100
  • Mac-eudora-version: 6.0a27

At 5:12 am -0600 20/7/03, Johnny AppleScript wrote:

choose from list theList
-->{"Jane"}

How do I get the numeric value (2) of "Jane"?

Many years ago there was the listselect osax which was 100 times better than 'choose from list' and allowed all sorts of variations. Unfortunately 'choose from list' has never developed, so you have to do something like this:


set _list1 to {"Tom", "Jane", "Dick"}
set _choices to choose from list _list1 with multiple selections allowed
set _indices to {}
repeat with _choice in _choices
repeat with i from 1 to count _list1
if contents of _choice is item i of _list1 then set end of _indices to i
end repeat
end repeat
_indices


JD




.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Get Number of Choose From List?
      • From: "Johnny AppleScript" <email@hidden>
References: 
 >Get Number of Choose From List? (From: "Johnny AppleScript" <email@hidden>)

  • Prev by Date: Re: My apologies
  • Next by Date: Re: Controlling iTunes Remotely
  • Previous by thread: Get Number of Choose From List?
  • Next by thread: Re: Get Number of Choose From List?
  • Index(es):
    • Date
    • Thread