Newbie question: extracting records from lists
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.