• 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: help in scripting Address book
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help in scripting Address book


  • Subject: Re: help in scripting Address book
  • From: Michael Terry <email@hidden>
  • Date: Wed, 26 Nov 2003 15:58:42 -0800

On Nov 26, 2003, at 1:36 PM, Gordon Beckhart wrote:

want to read the phone numbers in Applescript. How does one get the home or work or other phone numbers?
frustrated in Jersey
gordon Beckhart


Here's one way:

tell application "Address Book"
set friendToFind to first person whose name is "BJ" and last name isn't "Smith"
set hisNumbers to value of every phone of friendToFind
end tell

It can be a little confusing reading application dictionaries. Under the 'Address Book Script Suite' you can find the relevant classes. You might naturally think that (the only slightly oddly named) 'phone' class is what you're looking for, and you'd be right. But make sure you understand that where it lists 'contact info' next to '<inheritance>', what it's saying is that you need to check the 'contact info' class to find inherited properties which also apply to this class. So, when the script above references 'value', it is asking for a property of the 'phone' class which was inherited from 'contact info'. Make sense?

Cheers,
Mike
_______________________________________________
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.

References: 
 >Re: help in scripting Address book (From: Gordon Beckhart <email@hidden>)

  • Prev by Date: Re: help in scripting Address book
  • Next by Date: Re: deleting text
  • Previous by thread: Re: help in scripting Address book
  • Next by thread: set FP brightness
  • Index(es):
    • Date
    • Thread