Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Change Address Book numbers to international format Apps
I travel internationally and get annoyed when my Address Book numbers (that sync with my cell phone) aren't in international format (+-country code-area code-number). I looked around a bit and couldn't find a good script for this so I wrote one (24.4KB download, macosxhints mirror). This will take a selection in Address book and do its best to parse a recommended substitute, based on a bit of information given in the script properties and on the city and country of the contact itself.

If I had the time, I would clean this up and release it under my Wooden Brain Concepts hat. To do that would mean mostly adding a much fuller list of country and city codes -- right now they are limited to my own most-common use. But the script comments explain how to put in your own. (If anyone knows of a good, fast, free machine-readable site to curl this sort of data from, please let me know! It needs to get country codes for countries and both city/area and country codes for cites.) However, I still thought others may find it useful in its current state, so here it is.
    •    
  • Currently 2.00 / 5
  You rated: 1 / 5 (5 votes cast)
 
[16,139 views]  

Change Address Book numbers to international format | 4 comments | Create New Account
Click here to return to the 'Change Address Book numbers to international format' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Source for Phone and Country codes
Authored by: djweeks on Mar 20, '07 11:41:26AM
One possible source for the phone and country codes could come from the OpenBSD /usr/share/misc area: inter.phone and countrycodes.

http://www.openbsd.org/cgi-bin/cvsweb/src/share/misc/inter.phone
http://www.openbsd.org/cgi-bin/cvsweb/src/share/misc/countrycodes




[ Reply to This | # ]
Source for Phone and Country codes
Authored by: loren_ryter on Mar 25, '07 03:55:34PM

thanks... that first one could be useful, but alas only for Europe. I wish there were some persistant url that covered the whole world. i suppose the problem is that it would be hit all the time. :(



[ Reply to This | # ]
Change Address Book numbers to international format
Authored by: cgoodwin on Mar 21, '07 04:16:01PM

Would it be possible to write a similar script to change the format from +1-212-333-3333 to +1.212.333.3333? If I was more AppleScript literate I could do it, but it must be simple. Great script, though.



[ Reply to This | # ]
Change Address Book numbers to international format
Authored by: loren_ryter on Mar 25, '07 03:53:31PM

Actually, that wouldn't be so trivial a change in any comprehensive way. (But read on...)

In fact I'm not sure how the script would behave if your numbers were already formatted this way. It in part depends on some dashes to signal country and area codes, and thus to put separators (in this case dashes) back in. If I ever have time to return to this I will look into it.

But may I ask why? And what would you call this format if I wanted to make it a properties preference later on?

Now then, there should be a sort of quick-and-dirty thing you could do, which is after the line:

set this_number to reformat(aNumber, aCountry, aCity) of me

insert the line:

set this_number to replace(this_number,"-",".") of me

I have not tested this beyond a single number. All this would do is replace "-" with "." but AFTER all other formatting is done. As I explained above, this doesn't deal with the possiblity that your numbers were originally separated with "."




[ Reply to This | # ]