Running 2 Macro Schedule Macros concurrently

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
evangelmike
Pro Scripter
Posts: 56
Joined: Sun May 11, 2008 9:39 pm

Running 2 Macro Schedule Macros concurrently

Post by evangelmike » Fri Aug 29, 2008 3:32 am

Greetings! I would like to run a very long macro which, after running a few minutes, would call a second macro and then wait for a window having DONE as the first four letters of the window name. This would be done by using the instruction:
WaitWindowOpen>DONE*

The second macro which would run concurrently with the first macro would open either of two windows depending on conditions and then exit. The first window is named DONE1, and the second window is named DONE2.

The first macro would then use the IfWindowOpen instruction to determine whether the second macro had opened Window DONE1 or window DONE2 as follows:
[code]
IfWindowOpen>DONE1
Press Esc // Close Window
(First set of logic)
Else
Press Esc // Close Window
(Second set of logic)
Endif
[/code]

Is there any way to have 2 Macro Scheduler macros run concurrently instead of sequentially?

Thanks in advance for your help.
May you have a blessed day!

Michael D Fitzpatrick
Reg. US Patent Agent

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

Post by JRL » Fri Aug 29, 2008 4:43 am

I posted the Happy Button script primarily to demonstrate a way to do what you are asking. The Happy Button script will call and run a secondary script whether or not the calling script is compiled or uncompiled.

The task is easier if the calling script is not compiled. When the calling script is not compiled, you can call and run a second (or third or fourth etc.) script three different ways.

- Using the Macro> function which will pause the calling script until the called script is completed and ends.

- By using the Run Program> function which will pause or not pause the calling script depending upon the value of the RP_WAIT system variable. If RP_WAIT is set to 0 (zero) the calling script and the called script will run concurrently. If RP_WAIT is set to 1 (one) the effect will be the same as using the Macro> function.

- Using the ExecuteFile> function will call and run a script assuming the .scp extension has been associated with Macro Scheduler. The calling script and the called script will run concurrently.

Hope this answers your question.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Aug 30, 2008 2:43 am

You may also want to make sure that you SetFocus>WinowName before using Press>ESC
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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