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