Add +1 To All Contacts (USA)
I found an older AppleScript to add "+1" to all existing telephone number in Contacts (formerly Address Book"), however, it fails with the error "Syntax Error: Internal Table Overflow." when trying to compile the script. I am a novice with AppleScript, so am hoping someone can provide some guidance.
I did change "Address Book" to "Contacts", however, that made no difference. The original author of the code said he had moved to Japan, thus the 0 conditions in the code. I just want to add the +1 since I am in the United States and all my contacts are in the United States, rather than abroad. I currently have 384 contacts. I am using macOS X 12.1.
Thank you.
tell application "Address Book"
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
end if
end repeat
end repeat
save
end tell
MacBook Pro 15″, macOS 12.1