Create Contacts in the OS X Address Book

Create Contact in OS X Address Book Screenshot

Description

An example file demonstrating how to add entries to the Address Book on OS X from FileMaker using AppleScript.

Version: 1.0 [ Download ]
Date: January 24, 2010

Alternatives

In addition to AppleScript there are other options for working with the OS X Address Book from FileMaker including:

  1. vCard

    vCards can be created from FileMaker with an XML export and also with the aid of a plug-in.

  2. Address Book Manipulator

    A plug-in from Productive Computing that enables searching and importing from the Address Book in addition to creating new records.

  3. Froodware Address Book Plug-In for Filemaker

    A plug-in that enables you to copy contacts from the Address Book to FileMaker, and the other way around.

AppleScript Sample Code

An example of the AppleScript used to create the Address Book entry is:

tell application "Address Book" set thePerson to make new person with properties ¬ {first name:"Dee", last name:"Velhopa", ¬ organization:"Paws On Error"} -- see the "Address Book" AppleScript dictionary -- for other attributes than may be added make new email at end of emails of thePerson with properties ¬ {label:"Work", value:"dee@pawson.error"} make new phone at end of phones of thePerson with properties ¬ {label:"Work", value:"+44 0161 715 7028"} make new url at end of urls of thePerson with properties ¬ {label:"Work", value:"http://www.pauseonerror.com/"} make new address at end of addresses of thePerson with properties ¬ {label:"Work", street:"MellowBank", city:"Bored End", ¬ state:"Bucks", zip:"SL8 5AJ", country:"U.K."} save end tell

And the AppleScript to open the new record in the Address Book is:

tell application "Finder" set theURL to "addressbook://" & id of thePerson open location (theURL) end tell

Requirements

Earlier versions may work but have not been tested.

Feedback, Suggestions & Bug Reports

Please send any feedback, suggestions or bug reports via the Contact form. If you have a suggestion for how this might be improved I'd be very interested in hearing it.

License

Copyright (c) 2010, Mark Banks
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Contact | FileMaker | Home

© 2010 Mark Banks. Last modified: April 26, 2012