Skip to main content
November 14, 2014
Question

How to pause a script then resume?

  • November 14, 2014
  • 2 replies
  • 2051 views

Hello all,

Is there any way I can pause the running of a Photoshop script, do some manual actions, then continue with the running of the script (when I press a key or hit OK in some sort of dialogue). Did some research on this, no solution yet.

If at the point in the script where I want it to pause I add sleep or show an alert, Photoshop is locked, and I can no longer work in the background...

Can this be done?

Thank you!

This topic has been closed for replies.

2 replies

d1g1talphyre
Inspiring
November 14, 2014

I've wrote a similar script actually.  How I worked around this was to write any values i needed to keep track of into the keywords.  So the first half of the script did its thing, wrote values.  Then I did the manual parts.  Ran the same script again, but in the beginning of the script it looked for a keyword.  If said keyword was there, skip to second half and complete what it was doing.

Hope this helps.

Chuck Uebele
Community Expert
Community Expert
November 14, 2014

Yep, thought of doing that, but decided to go with the xml route. I've got a trigger in the xml file with all my variables that if it's set to true, it will start start running the script from a different place, that way I don't load up the file with variables, as I've got a bunch of photogs that use the script, and I didn't want to overwrite any info they might have added to any of the metadata fields. with my recursive function, it's super easy to change the UI and not have to worry about the order in which the variables were saved. By naming the variable, I can point to the correct node in the xml to retrieve it. If you have PS CC, you can look at a file in the presets\deco folder called _menu.jsx (I think that's what it's called). Do a search in the script for "uebele". Adobe used my recursive script to create preference files, so they put my name right be for that section of the code. It could be modified to restart a script.

November 14, 2014

Thank you both, valuable info! Probably will go with xml, thanks again!

Chuck Uebele
Community Expert
Community Expert
November 14, 2014

I don't know of any way. They only work around I know is to write a csv or xml file with all your variable so that you can do a restart with them all loaded.