OSX howto code ideas

Formatting for import to OS X address book

Address Book Import Format

Just spent an hour working out how to output a list of contacts from a web application in the correct format so that it can be imported into the address book in Apple OS X.

It's basically a simple text file with the values separated by tabs and each distinct entry separated by a new line. The clever bit is that by using the first line (which might normally be labels in a file exported from a spreadsheet) to indicate the content of the subsequent 'columns' of tabbed values, you can give address book a clue as to their content, so that it imports it correctly.

The labels I've found to work are as follows:

first
middle
last
prefix
suffix
nickname
address (home) street
address (home) city
address (home) state
- N.B. it does not seem to respect localised address formats like 'address (home) county' or 'address (home) postcode'
address (home) zip
address (home) country
phone (home)
url (home)
email (home)
jabber/icq/aim/msn/yahoo (home)
note

Obviously you can change the value of (home) to match your requirements - i.e. phone (work), address (other).