home
NOTE: Under Construction - I'm in the middle of upgrading my site and lots of stuff is kinda broken. Please forgive the mess.

Clearing the Adobe ExtendScript ToolKit Console Window

While creating a new JavaScript to automate some day-job Photoshop work, I gave Adobe's ExtendScript Toolkit a spin. It's designed specifically for building scripts for Adobe products and it's pretty nice. Especially the JavaScript Console window that makes it nice and easy to see debugging messages.

February 2014

By default, this window doesn't clear itself before each run which degrades a lot of its value. It can be cleared manually before the start of each test run, but that's a pain.

The good news is there's a way to do it with code. If the script is run from ExtendScript Toolkit itself, this snippet of code will do it:

Code
app.clc();
Code
if (app.name === "ExtendScript Toolkit") { 
  app.clc(); 
}
Code
if (app.name === "ExtendScript Toolkit") { 
  app.clc(); 
}
else {
  var estApp= BridgeTalk.getSpecifier("estoolkit");
  if(estApp) {
    var bt = new BridgeTalk;
    bt.target = estApp;
    bt.body = "app.clc()";
    bt.send();
  }
}
═══ § ═══