mercredi 5 mai 2010

SQLite to rule those silly AddressBook, Gmail contacts or Nokia for Exchange

I keep my contacts sync'd between my laptop, GMail and mobile phone via ... GMail.

On my laptop(s), I use iSync on MacOSX and conduit on Linux. They both provide two way sync.

On my phone, I use "Nokia for Exchange" since Google is nice enough to provide an Exchange compatible interface. NFE is configured to sync calendars and contacts.

Unfortunately, for some reasons, NFE or GMail won't sync contacts phone number if the phone label is set to "Other" or maybe just something else than "Mobile", "Home" or "Work" ... So one day, all you have left on your phone is an email for your contacts !@#

Of course, AddressBook and GMail don't provide any convenient way to modify all entries except that AddressBook database is an SQLite3 file.

$ sqlite3 $HOME/Library/Application\ Support/AddressBook/AddressBook-v22.abcddb
sqlite> UPDATE ZABCDPHONENUMBER SET ZLABEL='_$!!$_' WHERE ZLABEL='_$!!$_';
sqlite> .quit

You're done, all your "Other" entries should have been updated to "Mobile" (_$!!$_). Good night.