Contacts App Save issue

Hi,

I am suspecting a bug with Monterey but has anyone got a suggestion to get around the “Internal table overflow” issue when adding a Save command to a Contacts Applescript?

Previous similar issues seem to refer to the Applescript being too long but I can get the issue with the following script.

   tell application "Contacts"
 	set thePerson to make new person with properties {first name:"Test", last name:"User"}
 	make new email at end of emails of thePerson with properties {label:"Work", value:"test" & "@example.com"}
 	make new address at end of addresses of thePerson with properties {label:"Home", city:"Fakeville", street:"1234 Some St."}
 	save
   end tell

Cheers’

Iain

Hi,
Can’t help with solution but I have the same issue. The problem item in the script is the save command.
Even something as simple as
tell application “Contacts”
save
end tell
will not compile - gives syntax error. I had though that maybe there was a problem with my Monterey installation but went to the Apple shop this afternoon clicked into Script Editor on one of their machines and typed in the script as above. Same problem. Notice that no issue with retrieving data from Contacts problem is when you write information and then save. Hope at least this helps a little and I am looking forward to a solution. All the scripts I have still work with Big Sur. Also writing into Calendar works with Monterey. Looks like a Monterey issue with Contacts.
Cheers,
John H

Yep. I can reproduce the table overflow bug here. All you can do at this stage is report it to Apple and cross your fingers.

1 Like

Thanks guys for the confirmation that it is a Monterey bug. I have submitted Feedback, hopefully they will address it soon.

The script works for me in 12.0.1

Thanks for the info. I am on 12.2 so looks like they introduced a bug somewhere along the line.

I had another Contacts issue with an earlier version of Monterey that now works so hopefully they will address this one as well.

Seeing the same issue in the public release of 12.1.

tell app "Contacts" to save

Booted from Pre 12.1 version of Mac OS

wrote script named saveContacts.scpt with one line:
Tell application “Contacts” to save

Boot from current HD 12.1 version
replaced
save
to:
#save
set thescript to alias “MacintoshHD:Users:Library:Scripts:SaveContacts.scpt”
run script thescript

et voila, no script editor compiler errors and it works…