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: Timothy Bates <email@hidden>
- Date: Fri, 11 Apr 2008 14:29:37 +0100
On 10 Apr 2008, at 9:18 PM, Todd Geist wrote:
On Apr 10, 2008, at 12:55 PM, Philip Aker wrote:
tell application "Address Book"
item 1 of (every person whose id is "E28F0E618-55D1-4E37-BC2A-
A1D6FCB2B3AE:ABPerson")
end tell
Thank you but won't this just return the Person.
I am trying to get a reference to the email address by ID?
In the script editor, open the library (cmd-shift-L) and open address
book's dictionary.
type person into the filter box, and you will see that the emails of a
person are elements (not properties) of a person, and they are stored
as "email" objects.
So instead of
get email of person 1 (which would work for a property like <last
name>)
You need to say something like:
set theEmails to every email of person 1
set theEmailIWant to value of email 1 of theEmails
You could also do
tell application "Address Book"
set myGuy to item 1 of (every person whose id is "E28F0E618-55D1-4E37-
BC2A-A1D6FCB2B3AE:ABPerson")
set x to every email of myGuy whose label is "work"
return value of item 1 of x
end tell
_______________________________________________
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