• 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
Newbie question: extracting records from lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie question: extracting records from lists


  • Subject: Newbie question: extracting records from lists
  • From: Luke Evans <email@hidden>
  • Date: Sat, 13 Sep 2003 12:59:12 -0700

I'm trying to have a list of records from which I can extract or add
unique records (with a name as the key).
Such a list could be created like this:
set mylist to {{name:"bob", number:1}, {name:"fred", number:2},
{name:"eric", number:3}}

Now, with Applescript's rich reference types, you'd be tempted to do
something like this to get a certain record:
get first item of mylist whose name is "fred"
(or somesuch), but name is not a property, so this is apparently not
available.

I'm assuming that I'm left having to write my 'extractor function'
longhand using a loop and comparator for the name field... or is there
yet some pithy reference that will extract the first occurrence of a
matching record for me?

Luke
_______________________________________________
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.

  • Follow-Ups:
    • Re: Newbie question: extracting records from lists
      • From: John Stewart <email@hidden>
  • Prev by Date: apple mail again: awkward! can't open a message
  • Next by Date: Re: Newbie question: extracting records from lists
  • Previous by thread: apple mail again: awkward! can't open a message
  • Next by thread: Re: Newbie question: extracting records from lists
  • Index(es):
    • Date
    • Thread