Google Email Labels Fix

This is a fix for Google Contacts where contacts has been created with a custom email label.

Email with custom email labels will not sync to Windows Phone 8.1.

This happen in particular when using GO Contact Sync Mod with Microsoft Outlook.

So when the new contact is created it looks like this:

image

What we need is a label like “Work” or “Home”:

image

I have made a little Goggle apps script to fix this:

function fixcontacts() {
//  var contacts = ContactsApp.getContactGroup(‘My Contacts’).getContacts();  
  var contacts = ContactsApp.getContacts();  
  Logger.log(‘Start…’)
    for (var i in contacts) {
      var addressFields = contacts[i].getAddresses();
//      Logger.log(contacts[i].getFullName());
      var emails = contacts[i].getEmails();
      for (var j in emails) {
        var label=emails[j].getLabel()
//        Logger.log(label);
        switch (label) {
          case ContactsApp.Field.WORK_EMAIL:
//            Logger.log(‘OK’);
            break;
          case ContactsApp.Field.HOME_EMAIL:
//            Logger.log(‘OK’);
            break;
          default:
//            Logger.log(‘FIX’);
            Logger.log(‘Fixing ‘ + contacts[i].getFullName());
            switch (j){
              case ‘0’:
                emails[j].setLabel(ContactsApp.Field.WORK_EMAIL);
                break;
              case ‘1’:
                emails[j].setLabel(ContactsApp.Field.HOME_EMAIL);
                break;
              default:
                emails[j].setLabel(‘Custom’);
                break;
            }
            break;
        }
      }
    }
}

The script will ignore contacts already having the standard labels “Work” and”Home”.

Anything else with get replace with first “Work” and then “Home” for the second label.

Any subsequent labels will not be changed.

If you are not sure how to create and run scripts then read this Google page.

Oh by the way – using this script is on your own responsibility and there is NO support!

Færge Cafeen

Hidden gem of an old pub slightly off the beaten path.

WP_20150714_16_13_11_Pro__highres 

You can also sit outside around the corner and look at the boats in the canal.

The interior is traditional and very cosy and the landlord on the left is a great guy (and very entertaining!):

WP_20150714_14_38_37_Pro__highres

The food is traditional Danish of the very best quality:

WP_20150714_15_18_10_Pro__highres

In addition to a good selection of beers and wines they specialize in homemade snaps:

WP_20150714_14_30_08_Pro__highres

Some snaps’s are still in the making:

WP_20150714_14_38_11_Pro__highres

In Christianshavn:

wp_ss_20150715_0001