Re: Getting elements of a list
Re: Getting elements of a list
- Subject: Re: Getting elements of a list
- From: "Nigel Garvey" <email@hidden>
- Date: Wed, 16 Apr 2008 23:16:09 +0100
"Mark J. Reed" wrote on Wed, 16 Apr 2008 16:24:56 -0400:
>My main objection is that it requires you to know how many pairs there
>are. But it gives me another idea.. I'm walking to the car now and
>can't check, but would this work?
>
>repeat with {k, v} in myList
> set end of firstItems to k
>end repeat
No. But if you're only interested in the first item in each list, there's:
repeat with k in myList
set {end of firstItems} to k
end repeat
Not that I'd recommend it, of course. This is clearer and faster:
repeat with k in myList
set end of firstItems to beginning of k
end repeat
NG
_______________________________________________
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