Sure enough, I had listed a spouse field for John. This got me interested, as it makes use for holiday cards a little more personal. Next I added a spouse to one of my other entries, but much to my surprise, the special salutation was not created. I started experimenting, and eventually discovered some of the (undocumented) logic behind all this:
- Address Book looks at the country code (ISO code) of the address that will be used. If that country indicates US, Canada, France or UK, it is eligible for this special processing. This will not work for any other country, but this can be changed, see below.
- If the spouse's last name is identical, the entry will become John and Jane Doe, otherwise you'll get John Doe and Jane Smith.
- Entries for children are also eligible. Result could be John, Jane, and Baby Doe.
- It appears that if children are listed by first name only, and there is a single card in the Address Book with that same first name, or if they are listed by a full name and they have a card, they must have the same address on that card in order to be listed.
Some hints, tricks and tips:
- The country code defaults to your Mac's installation country (I presume), which means for most of us, it means the vast majority of our cards will have addresses in that same country. For US, CA, FR and UK users, that means special processing.
- The country code can be changed by clicking on the address label (home, work, etc.) while in edit mode, and selecting "Change Address Format..." Note that doing so will also force the contents of the country field to the same spelling as in the menu. For example, USA gets changed to "United States." You may later change this to whatever you want without affecting the country code. This is a bug in my opinion, but never mind.
- The country code is also accessible via AppleScript. The salutation, however, is not, nor can it be edited directly. If this were possible, it would be a lot easier to get around the logic if it does not do the right thing.
tell application "Address Book" set country code of first address of first item in selection to "nl" end tell - In some cases, the country code appears to be OK, and yet the formatting does not take place. Changing the country code to something else, and back, usually fixes this.
- Be meticulous about checking correct addresses on all cards for names that need to appear together, otherwise it won't work.
- The list of countries that gets this special treatment is controlled by a file called ABRelatedNamesConfig.plist, living inside the Address Book application bundle (control click the app and choose Show Package Contents), in the folder Contents:Resources. This file is in XML format, and contains entries with Boolean values set to yes for eligible countries. So you can set the boolean to no, or add lines for other countries. Use your favorite plist editor to do the work.

