From automating-mac-apps
Automates macOS Contacts via JXA with AppleScript dictionary discovery. Use when asked to "automate contacts", "JXA contacts automation", "macOS address book scripting", "AppleScript contacts", or "Contacts app automation". Covers querying, CRUD, multi-value fields, groups, images, and ObjC bridge fallbacks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/automating-mac-apps:skills/automating-contactsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- **Standalone for Contacts:** Use this skill for Contacts-specific operations (querying, CRUD, groups).
automating-mac-apps for: TCC permissions setup, shell command helpers, UI scripting fallbacks, and ObjC bridge patterns.automating-mac-apps skill (PyXA Installation section).name(), emails()), write with assignments.push()add ... to command or .people.push; handle duplicates defensively.whose for coarse filtering; fall back to hybrid (coarse filter + JS refine) when needed.make, then assign primitives and push multi-values; Contacts.save() to persist.person.id() exists after save; handle TCC permission errors..id() checksconst Contacts = Application("Contacts");
const email = "[email protected]";
try {
const existing = Contacts.people.whose({ emails: { value: { _equals: email } } })();
const person = existing.length ? existing[0] : Contacts.Person().make();
person.firstName = "Ada";
person.lastName = "Lovelace";
// Handle multi-value email
const work = Contacts.Email({ label: "Work", value: email });
person.emails.push(work);
Contacts.save();
// Handle groups with error checking
let grp;
try {
grp = Contacts.groups.byName("VIP");
grp.name(); // Verify exists
} catch (e) {
grp = Contacts.Group().make();
grp.name = "VIP";
}
Contacts.add(person, { to: grp });
Contacts.save();
console.log("Contact upserted successfully");
} catch (error) {
console.error("Contacts operation failed:", error);
}
automating-contacts/references/contacts-basics.mdautomating-contacts/references/contacts-recipes.mdautomating-contacts/references/contacts-advanced.mdautomating-contacts/references/contacts-dictionary.mdautomating-contacts/references/contacts-pyxa-api-reference.mdnpx claudepluginhub SpillwaveSolutions/automating-mac-apps-plugin --plugin automating-mac-appsSyncs person details to Apple Contacts: searches by name/email, creates if missing, updates incomplete info. For post-email workflows or on-demand use.
Reads, creates, updates, and picks contacts via CNContactStore, CNSaveRequest, and CNContactPickerViewController. Handles authorization, unified contact fetching, and key descriptors.
Manages Google People contacts/profiles via gws CLI: create/update/delete/list contact groups; list/search other contacts; batch create contacts.