Skip to content

Instantly share code, notes, and snippets.

@tkafka
Created September 17, 2023 08:17

Revisions

  1. tkafka created this gist Sep 17, 2023.
    15 changes: 15 additions & 0 deletions reset-contacts-configuration.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/zsh -f

    PATH=/bin

    bin="${HOME}/.Trash/$(date -u +%Y-%m-%dT%H-%M-%SZ)"

    if (( ${?} > 0 )); then
    exit 1
    fi

    mkdir -p "${bin}/Library/"{'Application Support',Caches,Containers,Preferences}
    mv "${HOME}/Library/Application Support/AddressBook" "${bin}/Library/Application Support" 2>/dev/null
    mv "${HOME}/Library/Caches/com.apple.AddressBookSourceSync" "${bin}/Library/Caches" 2>/dev/null
    mv "${HOME}/Library/Containers/com.apple.AddressBook" "${HOME}/Library/Containers/com.apple.AddressBook."* "${HOME}/Library/Containers/com.apple.ContactsAgent" "${HOME}/Library/Containers/com.apple.ContactsUI."* "${bin}/Library/Containers" 2>/dev/null
    mv "${HOME}/Library/Preferences/com.apple.AddressBook.plist" "${bin}/Library/Preferences" 2>/dev/null