Skip to main content
17 events
when toggle format what by license comment
Mar 4, 2017 at 8:07 comment added David Epstein @klanomath see my comment. Stack Exchange would not allow me to alert you in the same comment.
Mar 4, 2017 at 8:01 comment added David Epstein I have accepted the solution by @Synoli, which seems like the result of some hard work (I hope not only for me)! I changed shell to bash before each use---no big deal. If I had some expertise in sql and bash, I would have improved on the code by providing information from more of the fields available in normal use of Contacts.app. Perhaps I should have use the solution by klanomath---since I don't use iCloud, I had nothing to lose. I find it irritating that several Macos programs need backup via Export, in addition to Time Machine.
Mar 4, 2017 at 7:38 vote accept David Epstein
Feb 23, 2017 at 21:40 comment added Synoli @user3439894 Bash version is 3.2.57. My original script still works for me: pastebin.com/SMtvxDyK
Feb 23, 2017 at 20:42 comment added Synoli @user3439894 The script needs to use some kind of loop because there can be multiple sources for contacts. So the script in its current form should work for more users than a single hard-coded path would.
Feb 23, 2017 at 20:41 comment added user3439894 The default shell for OS X/macOS is BASH and your original code did not work in a default install even if the files existed as you had coded it, at least not on my system. What shell are you using?
Feb 23, 2017 at 20:37 comment added Synoli @user3439894 Not everyone uses the same shell, and not all shell environments are the same on every Mac. The original script worked fine for me right from the start when I tested it. Glad to hear it works for you now.
Feb 23, 2017 at 20:07 comment added Synoli @user3439894 I have updated my script in the meantime. It should now work properly for your case, too. Does it?
Feb 23, 2017 at 20:04 history edited Synoli CC BY-SA 3.0
Incorporate user feedback into script; should now work for most users
Feb 23, 2017 at 19:23 comment added Synoli @user3439894 To pinpoint the issue, please run find "${HOME}/SierraAddressBook" -name 'AddressBook-v22.abcddb' -print -exec bash -c '/usr/bin/sqlite3 "{}" .tables' \;. Does that give an error, or a list of Zxxxxx style table names? Does that list contain ZABCDRECORD? (Don’t publish the output here because it might contain a UUID which is unique to your computer.)
Feb 23, 2017 at 19:16 comment added Synoli @user3439894 Regarding your comment on Sources: You’re correct, there’s no Sources folder in some installations (no idea why). Feel free to add your variants to the answer (once figured out) so others can benefit.
Feb 23, 2017 at 19:09 comment added Synoli @user3439894 The * character cannot be inside the quotation marks. What happens if you try "${CONTACTS_BASE_DIR}"/AddressBook-*.abcddb instead?
Feb 23, 2017 at 18:13 comment added Synoli @klanomath While your approach is probably the quickest, easiest, and most pragmatic one, I would advise against it because I fear it might introduce issues with iCloud synchronization, which might come back to bite you when switching laptops after repairs.
Feb 23, 2017 at 18:10 history edited Synoli CC BY-SA 3.0
Remove redundant DISTINCT keyword; clarify non-endorsement
Feb 23, 2017 at 18:10 comment added klanomath Have you tried to just copy the (Sierra) /.../backup.*/.../${HOME}/Library/Application Support/AddressBook to (Yosemite) ${HOME}/Library/Application Support/AddressBook after renaming the old (Yosemite) AddressBook folder? A quick check using two life systems revealed that this seems to work.
Feb 23, 2017 at 18:04 history edited Synoli CC BY-SA 3.0
Remove redundant DISTINCT keyword
Feb 23, 2017 at 17:54 history answered Synoli CC BY-SA 3.0