It's hard to say without seeing the script but one thing I would check for is a $.write() or $.writeln() statement. Either of those would bring up ESTK( with the results of that line in the console ).
Next I would review all the code in any of the dialog controls callbacks. I have found that errors in a event handler don't always display an error message. Sometimes they don't even stop the scirpt. It just skips the code in the callback after the line that causes the error.
It was the $.writeln(). I just started using that for debugging instead of alerts. Is there a way to get debugging feedback like that and leave it enabled so the script is funcitonal for the end user but still debug friendly on the back end?
1 person found this helpful
There is no way I know of to tell the script to ingore $.writeln functions( other than commenting them out before saving the file ).
One thing you could do is write to a log file instead of the ESTK console. That way you have the best of both worlds. If there is no errors the end user isn't bothered and if there is you can ask for the log to be sent to you. Of course you would have to open/reopen the log file when debugging as the messages would no longer be sent to ESTK.
Xbytor has some code in xtools for creating error logs.
I like the idea of switching to a log file. I have used one in the past occaisionally. How does the file get handled if the script crashes? Does it get written at all then or only after the app closes?
I have wrapped my $.write() & $.writeln() in an if statement to a variable at the top… But soon got feed up with that…
Much easier is use the ESTK find and replace… find $.write replace //$.write
What I would do is put any code that might crash the script in a try/catch. In the catch block write the error to the log file then stop the script. In other words use try/catch so the script doesn't crash. The worst that could happen is it catches an error it can't handle and stops the script. That will give the script a chance to log the errror for later debugging and avoid the in your face defalut error message.