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.
npx claudepluginhub SpillwaveSolutions/automating-mac-apps-plugin --plugin automating-mac-appsThis skill is limited to using the following tools:
- **Standalone for Contacts:** Use this skill for Contacts-specific operations (querying, CRUD, groups).
Syncs person details to Apple Contacts: searches by name/email, creates if missing, updates incomplete info. For post-email workflows or on-demand use.
Queries macOS Contacts.app via AppleScript to lookup contacts by phone number or name, retrieving names, phones, and emails. Use for resolving phone numbers to names or searching the address book.
Fetch, create, update, and pick iOS contacts using Contacts and ContactsUI frameworks. Handles CNContactStore queries, permissions, saving, and SwiftUI pickers.
Share bugs, ideas, or general feedback.
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 = "ada@example.com";
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.md