So this is probably a question I am going to slap my head on but here goes:
I have simple script calling api getting results returned as list. The list is 26 items so I have been assigning variables similar to the method:
set {variable1, variable2, variable3} to listOfItems
then I have the following line:
if variable2 begins with “CUST” then
—do something here
end if
When running Script debugger, I get a table overflow error.
I have tried and received the same Table Overflow with:
if (text of variable2) begins with “CUST” then
—do something here
end if
I don’t understand why something so simple is causing a problem with Script Debugger.
What is in listOfItems?
Might help to post a snippet from the actual script.
(Also, when posting scripts put :
applescript on a line by itself before your posted script or snippet and
on it’s own line after. That way your script will appear in the forum in format, and be easy to open in your script editor.
This works for me…
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set listOfItems to {"CUST", {"CUST"}, "CUST"}
set {variable1, variable2, variable3} to listOfItems
if variable2 begins with "CUST" then
beep
end if
delay 1
if (text of variable2) begins with "CUST" then
beep
beep
end if
I stripped down my code to try an example and as soon as I removed the call Api code replacing it with a simple return some made up value and removed a use: customlibrary it no longer table overflows. I’m sure it’s the library being too long or a missing variable that will take me forever to find. I wish there was a way to search for variables being referenced once or some other trick for finding a called variable that doesn’t exist. Thanks for the quick response…your answer at least proved its something in my code.
1 Like
With script debugger, in debug mode, you can see which lines of your script executed on the last run (I don’t use that feature much but it has come in handy. I think it’s pretty reliable)