Sunday, November 13, 2005

OS X address book data model

I've got addresses everywhere. It's a mess. They're on my XP box, my Mac, my phone, my PDA, Outlook at work - all different sets, all different views.

I figured I could at least fix the phone -- a Palm OS (Samsung i500) that uses OS X sync services (Tiger) and MissingSync 5.0 to sync with my address book (and boy, is OS X sync ugly). All I needed was some documentation on what field names OS X Address Book expects on tab delimited imports.

Errrkkk. This is not documented!! I played around with various approaches and became increasingly aware just how complex the OS X Address book data model is. The best I could do at this draft was to create a really complex template, fill the slots, export to VCARD, and inspect in TextWrangler. Below is what I got. Sigh.

I need another angle on this!


BEGIN:VCARD
VERSION:3.0
N:Faughnan;John;Gordon;Dr;I
FN:Dr John Gordon Faughnan I
NICKNAME:jfaughnan
X-MAIDENNAME:Faughnan
X-PHONETIC-FIRST-NAME:Jon
X-PHONETIC-MIDDLE-NAME:Gordun
X-PHONETIC-LAST-NAME:Fawnun
ORG:MegaCorp;Cosmos
TITLE:Emperor
EMAIL;type=INTERNET;type=WORK;type=pref:jfaughnan@spamcop.net
EMAIL;type=INTERNET;type=HOME:jfaughnan@spamcop.net
item1.EMAIL;type=INTERNET:jfaughnan@spamcop.net
item1.X-ABLabel:_$!!$_
TEL;type=WORK;type=pref:111-111-1111
TEL;type=CELL:111-111-1111
TEL;type=HOME:111-111-1111
TEL;type=MAIN:111-111-1111
TEL;type=HOME;type=FAX:111-111-1111
TEL;type=WORK;type=FAX:111-111-1111
TEL;type=PAGER:111-111-1111
item2.TEL:111-111-1111
item2.X-ABLabel:_$!!$_
item3.ADR;type=WORK;type=pref:;;111 Erewon;Saint Paul;MN;11111-1111;USA
item3.X-ABADR:us
item4.ADR;type=HOME:;;111 Erewon;Saint Paul;MN;11111-1111;
item4.X-ABADR:us
item5.ADR;type=HOME:;;111 Erewon;Montreal;Quebec;A1H 1A1;Canada
item5.X-ABLabel:_$!!$_
item5.X-ABADR:ca
item6.ADR;type=HOME:;;111 Erewon;what;what;what;Portugal
item6.X-ABLabel:_$!!$_
item6.X-ABADR:pt
item7.ADR;type=HOME:;;111 Erewon;Escanaba;MI;49829;USA
item7.X-ABLabel:SecretBase
item7.X-ABADR:us
item8.URL;type=pref:http\://www.faughnan.com
item8.X-ABLabel:_$!!$_
URL;type=HOME:http\://www.faughnan.com
URL;type=WORK:http\://www.faughnan.com
item9.URL:http\://www.faughnan.com
item9.X-ABLabel:_$!!$_
BDAY;value=date:2001-01-01
X-AIM;type=WORK;type=pref:jfaughnan
X-JABBER;type=HOME;type=pref:jfaughnan
item10.X-MSN;type=pref:jfaughnan
item10.X-ABLabel:_$!!$_
X-YAHOO;type=HOME;type=pref:jfaughnan
X-ICQ;type=WORK;type=pref:jfaughnan
item11.X-ABDATE;type=pref:2001-01-01
item11.X-ABLabel:_$!!$_
item12.X-ABRELATEDNAMES;type=pref:Molly Thunderpaws Squirrelbane
item12.X-ABLabel:_$!!$_
item13.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item13.X-ABLabel:_$!!$_
item14.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item14.X-ABLabel:_$!!$_
item15.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item15.X-ABLabel:_$!!$_
item16.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item16.X-ABLabel:_$!!$_
item17.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item17.X-ABLabel:_$!!$_
item18.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item18.X-ABLabel:_$!!$_
item19.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item19.X-ABLabel:_$!!$_
item20.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item20.X-ABLabel:_$!!$_
item21.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item21.X-ABLabel:_$!!$_
item22.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item22.X-ABLabel:_$!!$_
item23.X-ABRELATEDNAMES:Molly Thunderpaws Squirrelbane
item23.X-ABLabel:_$!!$_
X-ABUID:29F3A180-BE1E-478D-B82F-B6A820F5BAB3\:ABPerson
END:VCARD


I need to think about this a bit. It would be nice if Apple documented some of this stuff, but documentation is not their strong suit.

No comments:

Post a Comment