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…

Not much use but I can also confirm this Monterey AppleScript Contacts bug.

Very frustrating as a I had a nice Keyboard Maestro Macro that used AppleScript to make new Contacts and now it’s broken. Hope Apple fixes this and I will submit Feedback too. I suspect it’s not high on their list.

I am having the same issue, running the script from osascript.
This was failing in OSX 12.1 on an iMac but was OK on 12.1 on a MacMini (I have no idea why). But after updating to 12.2 the MacMini was failing too.
Now I have to run the script on a very old MacMini OSX 10.15.7 and it runs OK.
On a MacBook Air on OSX 12.0.1 with the M1 processor, the scripts run OK. That appears to be the latest available for the M1 chip.

Looks like they fixed the bug, my scripts are working now in 12.3 Beta :grinning:

1 Like

Hooray! And I can confirm the Contacts scripts now work in the public 12.3 release that came yesterday.