Running multiple scripts

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Aldebaran
Newbie
Posts: 4
Joined: Thu Dec 26, 2013 6:46 pm

Running multiple scripts

Post by Aldebaran » Sun Dec 29, 2013 9:04 am

My compliments for this great product.

I have an issue when running multiple scripts at the same time. The scripts run flawless when running individually. I need to run multiple of these same scripts.

I created a reference file for each script so when a second or third scripts starts, it waits till the reference file is being removed....to prevent multiple scripts running at the same moment. The idea is that the running script finishes its tasks, removes the reference file and the second script is launched.

When the second script starts, it waits because it detects the reference file and goes into a wait loop until it sees no reference file. This works fine but......the first script stopts immediately! I can't figure out why.

My question: what do I have to do to run multiple scripts in a controlled way so they may start but wait for each script to finish their tasks.

Thanks in advance for your help.

Aldebaran
Newbie
Posts: 4
Joined: Thu Dec 26, 2013 6:46 pm

Post by Aldebaran » Mon Dec 30, 2013 11:34 am

After reading more about starting multiple scripts simultaneously, I came across this article:

http://www.mjtnet.com/blog/2006/09/15/r ... currently/

I changes my code so it works like described. Unfortunately this doesn't help. When I start the second script, the first running script stops immediately. I created 2 very simple scripts to reproduce this issue. I can reproduce the problem when starting both scripts from the Macro Scheduler via hotkey, trigger or manual started scripts.

It seems that the Macro Scheduler is the culprit here. When I start the scripts via the command line, they run fine (when you allow multiple instances).

So the question that stays open:

What do I have to do to run multiple scripts from the Macro Scheduler GUI?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Dec 30, 2013 2:07 pm

You might try creating a master script that runs the scripts that you want running simultaneously. The fact that your scripts run fine when run from the command line makes me think this might work.

Your master script would look something like:

ExecuteFile>macro1.scp
ExecuteFile>macro2.scp
ExecuteFile>macro3.scp

You might want to fully path the script names. If they need to start in a particular order you might want to install some wait>s between them

Aldebaran
Newbie
Posts: 4
Joined: Thu Dec 26, 2013 6:46 pm

Triggers

Post by Aldebaran » Mon Dec 30, 2013 2:49 pm

Thanks JRL for your response,

This is the only way to run scripts parallel. I used the trigger function from the scheduler to startup scripts. This way I can monitor a specific dropbox folder and start scripts remotely whenever I need/want. This didn't worked only with one script.

Creating a prestage script seems to be the only way. I can fire that prestage script via Dropbox. Via multiple IfFileExists routines the other scripts can be fired when necessary.

I think the documentation should be a bit improved on this part. It took me quite a while to discover that running scripts parallel isn't possible from one Macro Scheduler. The MS tells me that these scripts are actually running....but fails!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts