Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to stop running script??

Participant ,
Apr 09, 2009 Apr 09, 2009

Hi all

I've to stop running script through another script. is there a way to do it?

many thanks, H

TOPICS
Scripting
3.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2009 Apr 10, 2009

I'm curious what is the purpose of one script stopping another? Can you explain a bit?

JS, VBS, AS?

In General: you can stop a running script between statements. You can't stop a script while it's waiting for InDesign after giving a e.g. print-command, until the printing is done.

The Running script is probably a loop?

In each loop cycle it has to check (maybe several time) if the condition to Stop is there. If it is, it has to reset the condition and satop.

Apparently there are no Global Variables that scripts can share. You can use e.g. app.label.

I know of a solution that uses smal a disk file, named "stopnameofrunningscript". If the file is created, the script deletes it and quits.

Make sure that the script gives other scripts and apps enough time to do their thing, otherwise it takes ages before the other script can change the condition (e.g. interact with the user if that is desired). 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 10, 2009 Apr 10, 2009

Well, Actually I do an automation. It will automatically take files from a folder and flows one by one into indesign then places figures and tables. finally the indd files will be moved to production. In certain situation we'll have to stop the process.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2009 Apr 10, 2009

"Certain conditions": write a function that checks these conditions and make it the last statement of your loop?

Or do you want the user to pause/resume ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2009 Apr 10, 2009

what language - VB, JS, AS ?

robin

www.adobescripts.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 15, 2009 Apr 15, 2009

JavaScript

many thanks, H

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 16, 2009 Apr 16, 2009
LATEST

The simplest way to go about this is to check a script label every once in a while.

Something like this:

if (app.extractLabel("hakkimsPrivateLabel")=="exit"){

     AbortMyScript()

}

And then whenever you want to set the script to abort you simply set

app.insertLabel("hakkimsPrivateLabel","exit");

Harbs

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines