Skip to main content
zeffir.design@gmail.com
Participant
February 13, 2016
Question

How can I stop the script execution when dialog box is unavailable?

  • February 13, 2016
  • 1 reply
  • 1348 views

Hi community!

I wrote some script, but it takes a long time to execute (>10 minutes). So I need to allow the user to cancel the operation. But while script is running, the dialog box is unavailable to use.

Is anybody have a solution? Can I make an active Stop button, or some keyboard combination to stop script execution?

Cheers

This topic has been closed for replies.

1 reply

Chuck Uebele
Community Expert
Community Expert
February 13, 2016

On Win, I hit the escape key - sometimes you have to hit it several times. One thing about scripts, which I'm not sure how to stop is that if you're doing repetitive tasks, like something in a loop, the script will execute faster than PS can keep up, so even though you stopped the script, PS keeps running until it reaches that point where you stopped the script.

zeffir.design@gmail.com
Participant
February 13, 2016

Chuck Uebele написал(а):

... One thing about scripts, which I'm not sure how to stop is that if you're doing repetitive tasks, like something in a loop...

Yes, I use loops, so script does not respond on escape hitting

zeffir.design@gmail.com
Participant
February 13, 2016

One of the ways is to put app.refresh(); in to the working loop. Then script stops when I hitting escape, and "Close" button works too, but the script works slower...