Last active
December 3, 2024 11:45
-
-
Save joubin/12f6fd0a8e6f1d28d948a85be25c20eb to your computer and use it in GitHub Desktop.
If you are like me, you've carried over your contacts for many years. Sometimes from the years where you didn't have any contacts in different area codes. Over the years, I've updated the contacts without area codes manually. Recently, I left the country and ran into a problem calling US numbers with a European sim in my phone. The cooperate, no…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Contacts" | |
repeat with eachPerson in people | |
repeat with eachNumber in phones of eachPerson | |
set theNum to (get value of eachNumber) | |
if (theNum does not start with "+" and (theNum does not start with "1" and theNum does not start with "0")) then | |
set value of eachNumber to "+1" & theNum | |
else if (theNum starts with "1") then | |
set value of eachNumber to "+" & theNum | |
end if | |
end repeat | |
end repeat | |
save | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment