Links from the mac Contacts app resolved to wrong contact

two links generated by the hook for different people from the mac Contacts app do not work correctly when used in another one type app, ex: Obsiian or Day One. For example, the following two links:

Antonio Carlos Carlos


open someone else’s app Contacts that was opened directly last time and does not belong to any of the links generated by the hook.

Did you unsync and resync your icloud contacts?

on Linkable Mac Apps – Hook Apple Contacts is listed as only partially supported due to the following:

  • :thinking: Apple Contacts : however Apple’s contact IDs are local to the current installation. Unsyncing from iCloud and resyncing can lead Apple to provide different IDs.

For Apple’s Contacts app, in the future we intend to include other data (such as email address) in the URL to improve the robustness of links to Contacts.

The current script is this

tell application "Contacts"
                set theSelection to selection
                set theContact to item 1 of theSelection
                set aurl to "addressbook://" & id of theContact
                end tell

For resolving these URLs, we pass the ID we get from Apple Contacts app back to Apple Contacts app; so if there’s a different result given, that means Apple’s Contacts app is behaving inconsistently on the “get address” or resolution side.

If you know AppleScript you can put the ID in the Script Editor app to see.

2021-08-13 15:05: I corrected a typo, replacing “in the field” with “in the URL”