• 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: "Mark J. Reed" <email@hidden>
  • Date: 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



On 4/16/08, Mark J. Reed <email@hidden> wrote:
> Ah, good ol' destructuring bind.  Good thought.
>
>
>
>
> On 4/16/08, Stan Cleveland <email@hidden> wrote:
> > On 4/16/08 12:39 PM, "Stockly, Ed" wrote:
> >
> > > set myList to {{1, 2}, {3, 4}, {5, 6}}
> > > set {a, b, c} to myList
> > > set firstITems to {first item of a, first item of b, first item of c}
> >
> > Or here's another slight variation that I prefer:
> >
> > set myList to {{1, 2}, {3, 4}, {5, 6}}
> > set {{a, b}, {c, d}, {e, f}} to myList
> > set firstITems to {a, c, e}
> >
> > Stan C.
> >
> >
> >  _______________________________________________
> > 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
> >
>
> --
> Sent from Gmail for mobile | mobile.google.com
>
> Mark J. Reed <email@hidden>
>

--
Sent from Gmail for mobile | mobile.google.com

Mark J. Reed <email@hidden>
 _______________________________________________
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

  • Follow-Ups:
    • Re: Getting elements of a list
      • From: Stan Cleveland <email@hidden>
References: 
 >Re: Getting elements of a list (From: "Stockly, Ed" <email@hidden>)
 >Re: Getting elements of a list (From: Stan Cleveland <email@hidden>)
 >Re: Getting elements of a list (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Getting elements of a list
  • Next by Date: Re: Automation Sans Window Server
  • Previous by thread: Re: Getting elements of a list
  • Next by thread: Re: Getting elements of a list
  • Index(es):
    • Date
    • Thread