It syncs contacts from a Apple Contacts group named “Shortcuts demo” with Obsidian.
The end result will be a single note for each contact, with up-to-date contact details in the file properties. When the workflow is run again, it’ll find existing notes and update them. If it finds contacts without a note, it’ll create a new one.
The entries in Contacts will gain a clickable link to the Obsidian note.
Please note: The workflow will only work on macOS since it’s using Applescript which is not available on iOS.
Checks whether contact has phone or email before attempting to add them to the dictionary.
2023-12-11
Uses Obsidian 1.4+ file properties instead of writing YAML
Uses Contacts’ own Shortcuts action for storing the Obsidian note URLs for contact
Obsidian note URLs in Contacts are stored under the label “URL” now (was: “Obsidian note”). It’s a result of using Contacts’ own actions.
2023-03-17
Adds support for contacts that have more than one phone number or mail address. Numbers and addresses are added to the front matter as YAML lists ([1, 2, 3]) now.
2023-02-09
Updated the downloadable workflow with a correctly Apple-signed version. Same workflow, just installable now. Sorry for the hiccup!
The [Birthday] part is a property of the contact, so start with inserting the contact variable there, then tapping the contact variable, which will give you the list of all its properties, where you can pick the birthday.
In the part which updates the note, duplicate the “Search and replace” actions and update the properties as needed. The search term in the screenshot means “find the bit that says phone: and the rest of its line”, so sticking to the birthday example, you’d use /birthday: .*/ here.
It throws an error of the type: "Contacts got an error: Can’t get person {“Name”} of group “Contacts”. Does that mean this person is not in the group? It got a first person just fine but then stopped.
I’ve updated the workflow (see the version history in the original post). One less Applescript, one less problem.
I couldn’t reproduce the issue you have, @Reasder. The only thing I can think of what could cause this is a person w/o full name (maybe it’s just a company?), because the Applescript looks up the contact by its full name, and it checks not only the target group but all contacts.
Update: While updating the workflow I noticed that AFO’s Get Note Link action is returning incomplete URIs (the vault parameter is missing). I’m working on a fix right now!
I downloaded your Shortcuts from the app store today and set up the new pliugin in Obsidian. When I try to run this workflow, it quits every time after asking me for the name of my Obsidian vault.It stops before interacting with my contacts or Obsidian. Any ideas?
When you say “it quits”, what do you mean exactly? Do you get an error message, or does it just stop? Is it possible there are no contacts that fit the bill, i.e. that there is no Contacts group “Shortcuts demo”? (If you click the group name parameter in the “Find contacts” action, it should show you all groups in your address book. If you create a new group in Contacts, you’ll have to close the workflow and re-open it to make Shortcuts reload your address book structure.)
And you’ve completed the vault linking in the app, correct?
thanks for the quick reply and many thanks for the tool, now I see light at the end of the tunnel ;). Trying to integrate O365 and obsidian for a while (which does not work well under Windows), but only recently switched to MacBook Air M2.