Re: Address Book: Getting a reference to email by ID
Re: Address Book: Getting a reference to email by ID
- Subject: Re: Address Book: Getting a reference to email by ID
- From: Christopher Nebel <email@hidden>
- Date: Fri, 11 Apr 2008 11:23:24 -0700
On Apr 10, 2008, at 12:41 PM, Todd Geist wrote:
Each Email address has a unique id. I am trying to find a way to
get a reference to an email by it's unique ID. Try such things as
this:
set thePerson to person id "28F0E618-55D1-4E37-BC2A-
A1D6FCB2B3AE:ABPerson"
set theEmail to email of thePerson whose id =
"1BEDC46D-1C22-4B1C-941E-3FC24D3CCAE0"
has not worked.
A peculiarity of "whose" expressions is that they're implicitly lists,
so you have to say "*first* email of thePerson whose ...", even though
there's at most one match. Of course, this being an id, you don't
need the "whose" test:
set theEmail to email id "1BEDC46D-1C22-4B1C-941E-3FC24D3CCAE0" of
thePerson
If you wanted to get the email object given only the id and not the
person, I'm afraid you're out of luck -- Address Book doesn't define a
global "email" relationship, only "email" in relation to a person.
(The Objective-C API might be able to do it, but I've never checked.)
--Chris Nebel
AppleScript Engineering
_______________________________________________
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