• 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: "Johnny AppleScript" <email@hidden>
  • Date: Sun, 20 Jul 2003 07:18:00 -0600

Sweet! Thanks! What you wrote looks very similar, but substantially shorter
than what I recall having at home. I needed it to clean up an iTunes script
I had roughed out awhile back, and that I will post on the other thread
regarding remote playing of tracks.

Cheers!

JA

On 03/07/20 06:10 AM, "John Delacour" <email@hidden> 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
_______________________________________________
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: 
 >Re: Get Number of Choose From List? (From: John Delacour <email@hidden>)

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