Re: "a reference to"
Re: "a reference to"
- Subject: Re: "a reference to"
- From: Neil Faiman <email@hidden>
- Date: Sun, 6 Jan 2008 20:46:14 -0500
On Jan 6, 2008, at 8:08 PM, Michelle Steiner wrote: Even after writing scripts for nearly a decade and a half, I still haven't been able to wrap my brain around "a reference to". This script fails:
tell application "Address Book" set M_List_Group to people of group "Mailing Lists" set label of email 1 of every item of M_List_Group to "List" save addressbook end tell
The error is:
"Can't get email 1 of {person id \"1FFAD12D-6EAA-11D7-94DF-000393D49636:ABPerson\" of application \"Address Book\", etc.
This works:
tell application "Address Book" set M_List_Group to a reference to people of group "Mailing Lists" set label of email 1 of M_List_Group to "List" save addressbook end tell
At a guess ... in the failing case, you're getting a list back from Address Book. Then the "every item of ..." is just an ordinary AppleScript list operation, which doesn't get sent back to Address Book, and AppleScript doesn't know anything about the "email 1 of" form.
In the second case, the reference has to be resolved by Address Book, so the "email 1 of M_List_Group" gets sent back to Address Book.
Regards,
Neil Faiman
|
_______________________________________________
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