Skip to main content
Participant
September 9, 2021
Question

How to stop a long running script?

  • September 9, 2021
  • 1 reply
  • 1437 views

So I have some scripting that automates a number of pre-press tasks and occasionally the artwork is very complex which ends up bogging down the scripts. I would like to be able to cancel the script while its running but I havent figured out a way to interupt it.

 

Is there an interupt key combo I can press to stop a running script?

This topic has been closed for replies.

1 reply

ajabon grinsmith
Community Expert
Community Expert
September 9, 2021

It seems that the contents that appeared in the InDesign community in the past can be diverted.

https://community.adobe.com/t5/indesign-discussions/press-escape-to-stop-the-script/m-p/10939058

 

The escape key will stop the script.
In the case of Illustrator, you can get to the end by using loops or functions well.

var doc = app.documents.add();
var tf = doc.textFrames.add();
tf.top = 800;
tf.textRange.pointSize = "2pt";

while (ScriptUI.environment.keyboardState.keyName != "Escape") {
    tf.textRange.contents += "press esc key to stop the script.\r";
    app.redraw();
}