Install
openclaw skills install openclaw-macos-contactsRead, search, and safely create contacts in macOS Contacts (Address Book). Use when the user asks to inspect the native macOS contacts database, search contacts by name/phone/email/company, verify whether a contact exists, or add a new contact to Apple Contacts. Prefer this skill for production-grade contact access on macOS. Use SQLite for read-heavy search/list operations and AppleScript for writes, so reads stay fast and writes stay on supported system APIs.
openclaw skills install openclaw-macos-contactsUse this skill for production-safe access to the local macOS Contacts data.
Primary Contacts database on macOS:
~/Library/Application Support/AddressBook/AddressBook-v22.abcddbAddressBook-v22.abcddb-walAddressBook-v22.abcddb-shmscripts/contacts_sqlite.pyUse for read/search/list against the native Contacts SQLite database.
Examples:
python3 scripts/contacts_sqlite.py list --limit 20
python3 scripts/contacts_sqlite.py search "黄"
python3 scripts/contacts_sqlite.py search "1555555"
python3 scripts/contacts_sqlite.py get --name "Huang Liao"
python3 scripts/contacts_sqlite.py exists --phone 15555550123
Output defaults to JSON for easy downstream use.
scripts/contacts_swift.swiftUse for production-grade native contact API access via Contacts.framework.
Examples:
swift scripts/contacts_swift.swift count
swift scripts/contacts_swift.swift find --query "Huang"
swift scripts/contacts_swift.swift create --first-name OpenClaw --last-name Native --phone 15555550124 --email native@example.com
Use this path for create and duplicate checks before write.
scripts/contacts_applescript.pyUse for supported writes and API-level reads via Contacts.app.
Examples:
python3 scripts/contacts_applescript.py count
python3 scripts/contacts_applescript.py create \
--first-name OpenClaw \
--last-name Demo \
--phone 15555550123 \
--email demo@example.com
contacts_sqlite.py for fast read/search.contacts_swift.swift create or contacts_swift.swift update.contacts_txn.sh.contacts_txn.sh.references/schema-notes.md when you need table/field hints for SQLite queries.references/production-notes.md when designing higher-level automation on top of this skill.Use the bundled transaction helpers before destructive or multi-record write operations.
scripts/contacts_backup.shCreate a filesystem-level backup of the AddressBook DB and sidecars.
scripts/contacts_restore.shRestore a backup directory back into the local AddressBook store.
scripts/contacts_txn.shWrap a mutating command with automatic pre-backup and rollback-on-failure.
Examples:
bash scripts/contacts_backup.sh
bash scripts/contacts_txn.sh swift scripts/contacts_swift.swift update --identifier "CONTACT_ID" --job-title "Manager"
bash scripts/contacts_restore.sh ~/.openclaw/state/macos-contacts/backups/AddressBook-YYYYmmdd-HHMMSS
Use scripts/contacts_dedupe.sh only after listing duplicates and explicitly deciding which identifier to keep.
Example:
swift scripts/contacts_swift.swift duplicates
bash scripts/contacts_dedupe.sh KEEP_IDENTIFIER DROP_IDENTIFIER_1 DROP_IDENTIFIER_2
This workflow uses transactional delete wrappers so each delete is backed up and can roll back on failure.
Use scripts/contacts_merge.swift to plan or apply a merge of duplicate contacts.
Examples:
swift scripts/contacts_merge.swift plan-duplicates
swift scripts/contacts_merge.swift apply-plan --keep KEEP_ID --drop DROP_ID_1 --drop DROP_ID_2
Recommended workflow:
plan-duplicatesapply-plan with contacts_txn.sh before applying