Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

AppleScript Syntax Error automating Contacts: "Internal table overflow"

I've got simple script


tell application "Contacts"
	save
end tell



Which gives an error


"Syntax Error - Internal table overflow."


The error happens not when the script runs but before, when Script Editor interprets / auto formats the code (i.e. when clicking the button "Compile the Script")


I've been running this code for a few years without incident.

All other AppleScript / Contacts code continue to work just fine.

Did the syntax for the "save" command change?


Specs

Hardware: MacBook Pro (16-inch, 2019)

Mac OS: Monterey version 12.1 (21C52)

Contacts: version 2498.2.1

Script Editor: version 2.11 (227)

Posted on Jan 6, 2022 7:50 AM

Reply

Similar questions

10 replies

Feb 10, 2022 9:00 PM in response to ljr_nbg

I actually found problems after as well. Use of the command `delete people` no longer seems to work as before.

I ended up just coding the UI:

  • Open Contacts
  • Command A (select all items)
  • Delete
  • Use Command Line to import and replace all entries


Never elegant hacking the keystrokes to get the job done, but it's working.


What is your code trying to achieve?

Jan 10, 2022 8:44 AM in response to Cmq-Amq

I am having the same problem.

Script ran without problems for years on 10.14.6.

After upgrading the server to Mac mini M1 12.1 I am getting the same error ("internal table overflow").


Commenting out all the "save" commands will let the code compile and execute without error, but also without saving any changes....


Copying the script from the 10.14.6 server without opening it on 12.1 and running it via "osascript" kind of works, but there is a problem with saving phone numbers that was not there before. So I need to open and debug the script on 12.1


Same specs as above exept hardware: Mac mini M1, 2020, 16GB

Feb 5, 2022 3:02 PM in response to scottmil

I tested again and for me it's working. I suspect there's a difference in our code.


Mine does the following:

Delete everything in Contacts

Then at the Finder level open a VCF file containing all the contacts using the Contacts app.

In other words delete everything then replace everything


In earlier versions of MacOS I needed to issue the "save" command twice, once on deleting, once again on importing the new batch.

Now, with both "saves" eliminated it works.


I imagine you're doing something different?

Feb 14, 2022 6:32 AM in response to Cmq-Amq

We have a centralized contacts database using Filemaker.

From there we want to be able to (one-way) sync all contacts to different services (Exchange, our telephone system etc.).


It all worked great for the last years having a scheduled Filemaker Script that exported all new/modified contacts and then using cron/Applescript to add/update the contacts in the Exchange-Accounts addressbook.


For now all there is left to do is wait and hope, that Apple will address this issue.

Feb 17, 2022 12:43 PM in response to ljr_nbg

What about the approach, making use of keystrokes/key codes to "select all", "delete", "import all". It's admittedly a hinky way to code (I'm no fan of using keystrokes to jerry-rig automations), but it's actually working very smoothly. We have basically the same set up as yours: FileMaker-to-Contacts.app pipeline, except our Contacts.app is not connected to Exchange.

Feb 18, 2022 1:15 AM in response to Cmq-Amq

Could try that. But I am not a big fan of using UI-scripting/keystrokes on an unattended server.

For now, I am using the old server running 10.14.6 in parallel with the new one, just for this task:

Pulling the Filemaker export files from the new server and putting them into Contacts.

It works, but it's not quite what I imagined when I set up the new server....

AppleScript Syntax Error automating Contacts: "Internal table overflow"

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