Search code examples
adobe-illustratorextendscript

How do I debug a script relying heavily on an existing Illustrator document?


I'm using Adobe Illustrator CS5 and ExtendScript Toolkit CS5.

I've got a very involved script and alert() isn't working anymore because stuff is within a loop. How can I simulate the fact that I'm using a specific Illustrator document so that I can use the debugging features of ExtendScript Toolkit?

I want it to be the same as being inside an Illustrator document and going "File->Scripts->Scriptname". If I just test the script inside ExtendScript, I get an error on

if (app.documents.length > 0) {

Thanks!


Solution

  • Solved!

    I had to change the target application to Illustrator within ExtendScript Toolkit and set the debug level to $.level=2 to get it to work properly. I can now have breakpoints and all that good stuff.