Preventing history recording

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

JDG

Preventing history recording

Post by JDG »

Hi,

I'm trying to get a script to run without creating it's steps in PS History. I belive there's a suspend history command but I can't seem to get it to work.
I used XTools to convert an action to a script and the end of the output is as below:

Code: Select all
TestScript.main = function () {
  TestScript();
};

TestScript.main();



I guess I need to use the suspend history commands on the this part of the code but I could do with apointer on how to implement this.

Thanks!

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

pierrelabbe

Preventing history recording

Post by pierrelabbe »

Hi,
You can test this :
Code: Select allif( app.documents.length > 0  ){
   app.activeDocument.suspendHistory("STEP", 'traitement()');
   //"STEP" is what you see in History pannel, after traitement() is finish//
}
function traitement() {
   // what you have to do;
};
JDG

Preventing history recording

Post by JDG »

Thank you for your help - works great.