Fixing Mangled Contact Labels on iPhone

Image representing iPhone as depicted in Crunc...
Image via CrunchBase

A coworker sent this along.  I’ve had this issue on a few contacts and didn’t really have time to delve into it.

Name removed to protect the innocent and good intentions.  Be very careful with this and make sure you have a backup of all data that you plan to manipulate.

FWIW …

After serially using every calendar/address book interface under the sun and transitioning to Snow Leopard with Exchange syncing, I ended up with a bunch of munged Address Book extension labels in my iPhone Contacts like:

item1.X-ABLabel:_$!<EX-AssistantPhone>!$_

The extra long labels forces the text to be tiny, and rarely displays even then to say whether this is the work/home number.

If you encounter this problem and you’re a Mac user with a Unix background, I’m sure you can think of a dozen ways to fix this … else see some rudimentary Address Book/iTunes/command line steps below to handle large numbers of Contacts at once.

Caveat emptor.

The munged contacts had labels like:

item1.X-ABLabel:_$!<EX-AssistantPhone>!$_
item1.X-ABLabel:_$!<EX-BusinessFax>!$_
item1.X-ABLabel:_$!<EX-BusinessHomePage>!$_
item1.X-ABLabel:_$!<EX-BusinessPhone>!$_
item1.X-ABLabel:_$!<EX-EmailAddress1>!$_
item1.X-ABLabel:_$!<EX-Home>!$_
item1.X-ABLabel:_$!<EX-HomePhone>!$_
item1.X-ABLabel:_$!<EX-MobilePhone>!$_
item1.X-ABLabel:_$!<Other>!$_

… the bracketing parts are the problem. I can live with “HomePhone” versus “Home Phone”. YMMV.

Correcting this involves a few steps and a tiny bit of command line stuff:

– Attach your iPhone to your computer. Let it sync. Leave iTunes open.

– Open Address Book, select all your contacts, then File->Export to your Desktop, call it “backup.vcf” — don’t touch this file — if something goes wrong you’ll restore this.

– Do a second export of all the contacts to another file “munged.vcf”, or some name equally meaningful to you.

– Open a Terminal window, and cd to your Desktop (“cd ~/Desktop”). Just for paranoia’s sake, type “more *.vcf” and use the space bar to step through the files, making sure they contain all your contacts. Type “ls *.vcf” to confirm the files are the same size. Yeah — sheer paranoia, but who wants to reenter all their contacts? 🙁

– In the previously opened Terminal window paste this command and press return:

cat munged.vcf | sed -e 's/EX-//' | sed -e 's/_$!<//' | sed -e 's/>!$_//' > fixed.vcf

– in the Terminal window type “more fixed.vcf” — confirm the ABLabel fields are corrected before going onto the next step. If the fixed.vcf file doesn’t look right, stop and consult a local Unix person. You did something wrong or your problem wasn’t the one I had. Bail out or get help.

– Go back to Address Book, select all the contacts (if not still selected), then Edit-> Delete Cards. Delete all your contacts. Paranoia now seems appropriate.

– Go back to the iTunes window. Select the iPhone in the Devices list on the left (if not selected), then select the Info tab at the top of the main window and scroll to the very bottom to the Advanced items, select Contacts under “Replace information on this iPhone:”. Click Apply and let the phone sync. Check the Contacts on the iPhone to see they are gone.

– Go back to the Address Book window and File->Import, selecting (you guessed it) “fixed.vcf” from your Desktop. Check the reloaded vcards/Contacts.

– Go back to the iTunes window, and again select the option to Replace the Contacts info, Apply, and let the iPhone sync.

– Try the Contacts on the iPhone, and the labels should be corrected. Delete all the ancillary files on your Desktop.

– Avoid whatever odd combination of things you did that caused the problem in the first place. 😉

In case you want to mess with any other fields/changes, vcard format is described here: http://en.wikipedia.org/wiki/VCard.

Reblog this post [with Zemanta]

WWDC 2009 Music

I’m back from WWDC 2009.  What a wonderful time!  Sorry I didn’t update much about it, I was just too busy with my head buried in all the Apple goodness.  Oh my, do they have some good stuff in the pipe for you.

One of the greatest things about WWDC is the fabulous music they play before each and every session to keep the devs jazzed up.  There was a thread about collecting the songs that were played before each session because Apple wasn’t posting a playlist.  Fortunately, thanks to the iPhone, devs were walking into the sessions with Shazzam running and collecting information on any songs that weren’t recognizable and posting it to the thread.

Well, that thread has now developed into an iMix.  If you were at WWDC 2009 and want to purchase some of the songs you heard before the session, your wishes have been granted.

Reblog this post [with Zemanta]

When Address Book and MobileMe Fail to Sync a Record

MobileMe
Image via Wikipedia

If you find that there’s an address book card out there that isn’t syncing with MobileMe, your iPhone, or another Mac… check to see if there is an ampersand in the failing record anywhere.  Apparently once a card hits MobileMe, it doesn’t like the ampersand in the vcard and chokes on it.  If MobileMe chokes on it, all of your devices will be unable to find the new card.

Just another tip from yours truly.

I’m in New Orleans this week, working project stuff for the day job.  Lots of fun here.  More later.

Reblog this post [with Zemanta]

A Visit to Mission Control

If you were subscribed to my Twitter feed, you would have known in near real time that today I had one seriously exciting treat. I managed to squeeze my way into a tour group being led by the incredible Jack Garman here at Johnson Space Center. Think I would turn down such a chance? Absolutely not. Not only is Jack Garman a wonderful friend and professional mentor to me… today I learned much, much more about him… and I’m in simple awe. (Read the Wikipedia entry).

Even juicier, STS-126 is going on right now. While we were going through the MCC, we could see that the astronauts were in the middle of a spacewalk. They had been at it for about three hours when we walked around and examined all the folks at work.

It was just an incredible experience. The geek in me has truly been touched. We were allowed to take non-flash photos. All I had on me was my iPhone and never have I felt like I wanted to beg Steve Jobs for a better camera. Argh!

Anyway… cell phones aren’t allowed, so I put the iPhone in airplane mode and started taking pics. These aren’t all of the pics, but some of the better ones. Most of them are blurry (THANKS STEVE) and off-color, but salvageable with some work I GUESS… STEVE.

Here’s some of them. I’ll post a full album when I get home and have access to MobileMe. I only have iLife ’06 on this Macbook.

Reblog this post [with Zemanta]