Re: Get Number of Choose From List?
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.