Skip navigation
Currently Being Moderated

[CS5] InDesign Server LBQ - execute copy of a script?

Mar 22, 2012 8:05 AM

Tags: #scripting #lbq #load_balancing #indesign_server

Hello,

 

Currently we are using the LBQ (load balancing) to queue up scripts to be run on our instances in IDS. After the scipt is run, we're trying to (within our .NET code) delete the script file. This works most of the time, but every once in a while we get an IO exception stating that "the file cannot be deleted because it is in use." I've run several tests and narrowed it down to being directly related to IDS executing the script, but thats about as far as I've gotten.

 

One idea that came up was to see if IDS could possible open up a copy of the script file and execute it (whether that be an option of the LBQ EnqueueJob() method, or a configuration setting on the server itself). I know that from within a script you can open up other files "as copies" but I wasn't sure if IDS had a similar ability. This would be nice because it wouldn't have to open the physical script file, thus we'd never have any trouble deleting it.

 

Has anyone ever done anything like this or know of something similar we could try?

 

Many thanks in advance!

 

-lhan

 
Replies
  • Currently Being Moderated
    Mar 24, 2012 1:58 PM   in reply to lhanneman

    Have the script delete itself:

    app.activeScript.remove();

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 26, 2012 11:45 AM   in reply to lhanneman

    InDesign parses the script file when it opens and reads it. Once it's parsed, it's not really needed anymore.

     

    Any process other than InDesign can't remove it though, because InDesign has it open. Since InDesign owns the file, it can delete it.

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 26, 2012 12:27 PM   in reply to lhanneman

    BTW, regarding your original question, you can have one script open another script file, read it and execute it if you have the need. You can use either eval(scriptString) or app.doScript(scriptString).

     

    Harbs

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points