Google and Thunderbird store postal addresses differently, so converting one format to the other is difficult.  Google’s fields have multiple lines while Thunderbird has 6 separate fields.  gContactSync 0.1 would take Thunderbird’s 6 address fields (Address, Address2, City, State, Zip Code, and Country) and convert them into a new field that allows multiple lines like Google when a new contact from Thunderbird was first synchronized.  Contacts from Google would have their addresses directly synchronized with the new fields in Thunderbird.  However, it converted them in a hard-coded format (the standard US format) and removed the values in the old fields unless a hidden preference was changed.

0.2 will have a new preferences tab, probably similar to the screenshot below that allows for customization of how addresses are converted.

Preferences about postal addresses

Preferences about postal addresses

As you can see, you can customize how each address is created by placing the name of the property in brackets.  Anything not in brackets, such as spaces or punctuation,  is preserved.

You can find the properties used by Thunderbird here.

Here is the default for the home address, which is identical to the previous hard-coded method.

[HomeAddress]
[HomeAddress2]
[HomeCity], [HomeState]  [HomeZipCode]
[HomeCountry]

Lines that contain no letters are numbers are removed, so a contact with a HomeAddress and HomeCountry only will have two lines.

I’m going back home for the weekend so I won’t get much done with this over the weekend, but I would like to hear some opinions about how this looks and works.  If you don’t fully understand how it works from the description please let me know so I can make it more clear for you and everyone else.

I don’t have a version tested thoroughly enough and won’t for at least a week.  The newest source is in the CVS repository.

Categories: gContactSync

4 Comments

Peter Hollo · February 5, 2009 at 10:28 PM

This sounds good, speaking as an Australian!

It’s looking like multiple email addresses aren’t going to make it into TB3. Any chance you can find a way for us to use the email addresses past Thunderbird’s 2 per contact?

pi · February 6, 2009 at 8:31 AM

So far I haven’t done anything to make the e-mail addresses useful other than making them a mailto link in the card view. I’m going to look, but I am not too confident that I’ll be able to make them more useful, unfortunately.

Mark · February 14, 2009 at 9:52 PM

I’d been meaning to mention to you that synchronization wasn’t working at all on the Mac.
This is on TB 3.0b1.
When I click to sync it says “Synchronizing…” in the status bar, but that’s all it says, it just stays that way and nothing syncs.
Also, the icon has reverted back to where it inherits a whole slew of icons like it was before.

gContactSync 0.2.0a2 « Pi’s Blog · February 8, 2009 at 11:01 AM

[…] Customization of how addresses are synchronized […]

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.