Skip to main content
September 28, 2010
Question

Single History state

  • September 28, 2010
  • 1 reply
  • 740 views

I have a script that runs as the first thing in the action. I'd like to add some code to the script that makes the entire action a single history step instead of the 25+ steps I currently have. Is that simple to do?

Thanks guys!

This topic has been closed for replies.

1 reply

Muppet_Mark-QAl63s
Inspiring
September 28, 2010

With versions CS4 & CS5 you have the document method suspendHistory() which should allow a single history step with one undo. For versions before that you may be able the set the app.preferences.numberofHistoryStates to 1 but I have NOT tried this myself but Im almost sure you will get the undo functionality should you try this…

September 28, 2010

I'm on CS5 here at work. I should also point out that I know very little about coding. I tried to steal the "one history step" java code from another action that was in the default scripts for photoshop, I think it was the delete all empty layers script. It had code in there I thought I could borrow but It just errored when I dropped it in my script (in the beginning).

ian shook | lead artist | farm | cp |312.243.0044 x 104

Inspiring
September 28, 2010

If your action calls a script then does other things adding suspendHistory() to the script will only handle the history for the script. The rest of the action will create historystates as normal.

Is there a reason you are using a mix of scripts and actions? If you converted the other steps in your action to script you could then suspendHistory() for the whole thing.