03. V2 – Pushing Contacts [3:34]

Description: This video provides an overview of how to push contacts from FileMaker into Apple Address Book using the Address Book Manipulator.  This video was made with version 2 of the plug-in. Additional functionality is now available with version 3.


0:00 Thanks for choosing Productive Computing for your FileMaker needs. This video demonstrates pushing information from a FileMaker solution to the Mac Address Book using the Address Book Manipulator plug in. Throughout this video we will be working with the Address Book Manipulator demo file available from the AddressBookManipulator.com website.

0:18 Working with the demo file we first want to create some sample data to enter into the address book. I’ll navigate to the push tab and press the New FM Contact button. This fires a script to create a new record in the demo file that we will then push to the Address Book.

0:32 Next pressing the “push” button, calls a script that actually pushes the information into Address Book as a new record. Stepping into the script we see that creating a record in the Address Book is accomplished with PCAB_New function. The only parameter to this function is the string which defines the type of record to create. This is either a contact or a group. The demo file saves the Address Book ID that is returned by the function. This ID must be stored with your FileMaker contact for future access to the Address Book record. After calling the new function the new record is retained in memory and is ready to accept values for its properties.

1:12 Next the script calls the PCAB set value for property functions several times. This function sets the value for a given single value property. These are properties such as first name and company and will only have one value. The function takes the name of the property as a first parameter and the value for the property is the second.

1:33 The final single value property sets the flag for displaying the contacts in the Address Book. “Show us person” will display the contact as a person and “show his company” display his contact as a company record.

1:45 Next we come to the part of the script where multi value properties are set. These properties such as addresses and phone numbers are able to have more than one value and are also associated with the label, such as work or home. To set the several multi value properties this script makes several calls to the PCAB_AddMV function. The parameters to the function are the name of the property, the value to add to the property and the value associated label. The function returns to the identifier for the value just added to the address book record. The script stores this identifier, we call it the UID, in the demo file so that we can directly access and modify the particular value at a later date.

2:25 The address property is a special multi value property and has it’s own function for adding addresses to address book records. We see the plug in calls a PCAB_Add Address function passing it the following seven parameters. The label for the address, the street part of the address, the city part, the state part, the zip or postal part and the country part. The last parameter, the country code, is used to tell address book in which country the address is located and how to format the address to display to the end user.

2:57 Finally, after setting all the properties for the record, the script saves the changes to the Address Book record with the PCAB_Save function. This is a function that does not require any parameters. We see the last two steps of the scripts gather the modified date and creation date and saves this information in the address book.

3:15 That is it for writing a new record to the Address Book. Please be sure to view our other videos on using the Address Book Manipulator plug in. Thanks for watching.