Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help in scripting Address book



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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.