• 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
Re: Address Book: Getting a reference to email by ID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Address Book: Getting a reference to email by ID
      • From: Michelle Steiner <email@hidden>
References: 
 >Address Book: Getting a reference to email by ID (From: Todd Geist <email@hidden>)
 >Re: Address Book: Getting a reference to email by ID (From: Philip Aker <email@hidden>)
 >Re: Address Book: Getting a reference to email by ID (From: Todd Geist <email@hidden>)

  • Prev by Date: Re: Address Book: set property values dynamically
  • Next by Date: Re: Address Book: Getting a reference to email by ID
  • Previous by thread: Re: Address Book: Getting a reference to email by ID
  • Next by thread: Re: Address Book: Getting a reference to email by ID
  • Index(es):
    • Date
    • Thread