-
AE Script: try…catch not working
Hey,
I get into a bizarre situation when developing/running scripts with “Enable JavaScript Debugger” on.
The very first time a script throws an error in a
try...catchblock, the debugger stops and jumps into the code instead of handling the error in thecatchsection. After skipping the runtime error,try...catch-handling works perfectly fine until I restart After Effects and run a script that throws an error. Then it’s the same thing all over again: First time error – BAM – after this all’s well.For example, take this simple script:
try
{
var ob;
ob.expression = "COW";
}
catch(e) { alert ("Error Handling working."); }
The first time this code is executed, the debugger halts, telling me that “undefined is not an object”. Any subsequent script that is launched handles errors correctly. BTW, “Do not break on Guarded Exceptions” is enabled.
Weird behavior… Any ideas? If not, it would be great if anyone could test the above script – maybe it’s just my OS…
Thanks,
-Chris