• 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: Getting elements of a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Image Meta data Question
  • Next by Date: Re: Image Meta data Question
  • Previous by thread: Re: Getting elements of a list
  • Next by thread: Re: Getting elements of a list
  • Index(es):
    • Date
    • Thread