How can I change +44 to 0 in all my contacts in Address Book..?

As the subject asks.. Any idea's..?

ps. I'm UK based thus international +44!

MacPro 2x 2.8GHz Quad Core (OSX and Vista Ultimate), Mac OS X (10.5.6), MacBook Pro 2.4GHz, PM G4 466MHz, PC XP machine NOW on sale!! LoL..

Posted on Jan 21, 2009 2:04 PM

Reply
7 replies

Jan 21, 2009 2:40 PM in response to KingRichard1st

If you open AB's preferences, then click on the Phone icon in the toolbar, you can make changes to the template for displaying phone numbers including adding a custom template. However, I have no idea if you can make the change you want occur throughout your entries.

You can write an AppleScript to run through all entries in the database, locate phone numbers and change them.

Jan 21, 2009 3:01 PM in response to KingRichard1st

paste the following into Script Editor.

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "Address Book"
set mlist to selection
repeat with per in mlist
set NP to number of phones of per
repeat with i from 1 to NP
set curphone to value of (phone i of per) as text
if text 1 thru 3 of curphone is "+44" then
set value of phone i of per to "0" & text 4 thru -1 of curphone
end if
end repeat
end repeat
save addressbook
end tell</pre>



select all addresses you want to be affected in Address Book (this can be all your contacts) and press run in Script Editor.

Jan 21, 2009 3:42 PM in response to KingRichard1st

you mean to change all 0's to +44?

that would be this:


<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "Address Book"
set mlist to selection
repeat with per in mlist
set NP to number of phones of per
repeat with i from 1 to NP
set curphone to value of (phone i of per) as text
if text item 1 of curphone is "0" then
set value of phone i of per to "+44" & text 2 thru -1 of curphone
end if
end repeat
end repeat
save addressbook
end tell</pre>

Mar 16, 2009 1:24 PM in response to KingRichard1st

I had a similar situation but instead of changing the phone numbers I needed to add an area code to take me from 7 digits to 10 digits. I used part of the script on this page and part on another page and it worked for me. I built a little website that explains how I did it. Thanks for the help!

Oh if you want to see what I did:
http://web.me.com/jacobcroft/AddArea_Code_to_AddressBook/HowToAreaCodePhone.html

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I change +44 to 0 in all my contacts in Address Book..?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.