Table Overflow Errors

,

Originally published at: Table Overflow Errors | Late Night Software

One of the most infuriating AppleScript errors is also one that many users see at some stage: errOSAInternalTableOverflow. It is particularly annoying because when it happens AppleScript itself is usually corrupted, so you have to close and relaunch your editor. What does it mean, what causes it, and how can you avoid it? Apart from…

1 Like

Just as a data point (and the article is really interesting, thank you), I’m working on a 400 lines script where most of the data I have is stored in “set” variables.

I decided to convert the things to properties, about 50, a lot of them being lists and some of them being items of (list) properties.

After a while, the script stopped compiling. There was a property that I was trying to set to the empty list, and it worked, and when I added a second empty list property things started to go wrong. Removing the second empty list property was enough to allow compilation.

Anyway, I was quite surprised to see that even though I had a quite similar number of variables (before) than of properties (after), the script started to dysfunction quite early during the rewrite.

That begs the question (for a different thread): what are the best practices when it comes to variables vs properties?

What are the names of those empty list properties?

I have many scripts with numerous property declarations, often as empty lists, and never have this issue.

I have noticed that if you set a property value to a handler name, that can cause issues.

2 Likes

Names are very specific to my project and 100% unlikely to be used by the system.

So, first, there is no property with the same name as a handler, right?

When it fails to compile, what is the error message.

If this were happening with me, I would open a new script in SD, and copy and paste just the property calls and use statements and compile that. Then, one be one add handlers and compile until I found where the issue was.

That’s what I did. I started with my 50 lines property declarations and it failed with that “Table Overflow” error message after I added said properties. Maybe I should have restarted SD to start from a clean state, though.

As I say in the original post, as soon as you see the errOSAInternalTableOverflow error, assume that AppleScript has corrupted its self. At this point its not if AppleScript will either damage your script or pull Script Debugger down, its when.

If strange behaviour persists after a Script Debugger re-launch, try saving your script as text (.applescript), quit and re-launch Script Debugger and then open your script. I’ve seen cases where the bytecode saved to a compiled script file gets corrupted and strange errors appear when the script is opened.

2 Likes

I copied the code in BBEdit, quit SD, reopened it and started working with the code without problems. Thank you for your advice.