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


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.
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 | # ]