Contacts.app skipping (or creating empty files for) some contacts on vCard export #

Issue

Some contacts would not export to vCard from Contacts.app, instead exhibiting the following behavior:

Update

Maurits kindly wrote in with both the cause:

[T]he affected records have in common that in ZABCDRECORD, the ZDISPLAYFLAGS column is set to NULL for the affected records. This column seems to indicate whether an entry is a company (1) or a person (0). My suspicion is that older macOS versions didn't bother to write a 0, but kept it at NULL, whereas newer versions are explicitly expecting a 0 instead of a NULL. To bolster this theory, all affected entries were rather old ones.

and actual resolution:

Close Contacts.app, fire up sqlite3 on the AddressBook-v22.abcddb file and execute UPDATE ZABCDRECORD SET ZDISPLAYFLAGS = 0 WHERE ZDISPLAYFLAGS IS NULL;

The remainder of the post is retained for the sake of historical curiosity (and as a testament to my inextant SQL knowledge).

Resolution

Tested in macOS 12.6.1 Monterey and 13.2.1 Ventura with local (i.e., "On My Mac") contacts:

  1. Launch Automator.app

  2. Select "Workflow" and click "Choose"

  3. Select "Contacts" under "Library"

  4. Drag "Get Selected Contacts Items" into the workflow area at right and leave it set to the default "Get selected people"

  5. Drag "Export vCards" under that, select either "one vCard" or "individual vCard" from the "Export" dropdown menu, and select a destination in the "to:" dropdown menu

  6. In Contacts.app, select desired contacts to export

  7. In Automator, click Run

Exporting recalcitrant contacts with Automator

Notes

Related

History

/mac | Feb 19, 2023


Subscribe or visit the archives.