Script Debugger returns 1.234

I have a large AS library. Almost 300 handlers in it. This library can compile and save in SD but it cannot be debugged in SD, as switching to Debug mode succeeds, but the script cannot execute due to its size “the script has exceeded the limits of one or more of AppleScript’s internal resources”. When NOT in Debug mode the Run handler will execute. I do not have any top level commands, just properties and handlers.

After a run the result window displays 1.234 this appears to be a number not a string

This is not a crucial issue but what is going on here?

AppleScript has no debugging facility. To implement debugging, Script Debugger has to insert a lot of extra code you don’t see, and unfortunately that means they’re more likely to exhaust AppleScript resources. When it happens, the actual result can be anything.

Please see this post for a fuller discussion of errOSAInternalTableOverflow errors:

Be aware that even with debugging disabled, you are right near the edge and should take this as your cue to refactor your library into two (or more) libraries. When you are near the edge,AppleScript can begin to behave unpredictably and can cause Script Debugger to crash.

1 Like

Although here I am explicitly saying this occurs when NOT in SDs debug mode, it does seem this behavior is attributable to the quantity of code being compiled. I was just surprised to see any value bubble up from the execution of an empty script ( empty run handler ) context.

I appreciate the cautionary note. I’ve separated my library code into 15 libraries to avoid this. This only occurs when editing a composite library that loads 12 of them.