Skip to main content
Loic.Aigon
Legend
July 20, 2011
Answered

[AS]: run background script

  • July 20, 2011
  • 1 reply
  • 5056 views

Hello,

I have done an applescript which works fine. However some of the actions related to the system (do shell script...) are taking a while to complete.

And as long as they are running, user can't keep on working.

I was wondering if I could separate what is related to indesign from what is not related to Indesign in order to give control back on indesign to the user while soem actions are still processing on the background ?

I have found a way to dissociate script thanks to load script command but it doesn't prevent Indesign to freeze until the external script completion.

Do you think it's possible ?

Loic

This topic has been closed for replies.
Correct answer Muppet Mark

What I mean is AppleScript's 'do shell' command will wait for a response from the system… Im only Leopard so I can't say for sure if anything has changed… So this will hold your main script until a result/error is received before continuing with the rest of your commands… If you called system from Bridge or Photoshop then they would just send the shell string… And wait for nothing… Not locking up your main script…

1 reply

Inspiring
July 20, 2011

You can have asynchronous shell by swapping your app do script applescript do shell for a bridgetalk message to either photoshop or bridge… Both have app.system();

Edit:

Yep after posting that… It registered that you are NOT using ESTK javascript and calling AppleScript to do the shell… Just have either of the two apps do javascript with app.system();

if you have access to them…

Loic.Aigon
Legend
July 20, 2011

Hi Mark,

Thanks a lot for your input. So using do script will lead to main script exit while the code sent in do script will complete within Photoshop ?


Won't the main script wait for do script completion ?

Loic

Muppet MarkCorrect answer
Inspiring
July 20, 2011

What I mean is AppleScript's 'do shell' command will wait for a response from the system… Im only Leopard so I can't say for sure if anything has changed… So this will hold your main script until a result/error is received before continuing with the rest of your commands… If you called system from Bridge or Photoshop then they would just send the shell string… And wait for nothing… Not locking up your main script…