I want to add CardDav account in Contacts (AddressBook) using AppleScript. Also couldn't write script which can open "Contacts preferences".
Any suggestions?
I want to add CardDav account in Contacts (AddressBook) using AppleScript. Also couldn't write script which can open "Contacts preferences".
Any suggestions?
AppleScript GUI Scripting can open Contacts' preferences:
tell application "System Events" to perform action "AXPress" of process "Contacts"'s menu bar 1's menu bar item "Contacts"'s menu 1's menu item "Preferences…"
I don't know about programmatically adding a CardDAV account, though. I don't see commands in Contacts' "dictionary" for adding one, and I have no idea what files & plists would need to be created to add a CardDAV account behind the scenes.
To get an idea, I created a test CardDAV account, then looked at Finder's recently modified files. This is what I found, and there are probably more: