Code: Select all
Macro>%Script_Dir%\Daily labor.scp
Wait>5
Macro>%Script_Dir%\Sales Trend.scp
Wait>5
Macro>%Script_Dir%\Sales Data.scp
This has been very clean and very reliable for a long time. However, I've experienced some issues after recent software updates (not Macro Scheduler updates) where scripts will intermittently stop before they complete. The scripts all send me emails when they complete so I can discern which script failed but I don't know what within the failed script caused it to fail. When I run the scripts during the day they never fail. Very puzzling.
So I need to figure out a way to have the scripts report what they are doing as they are doing it. I could just use the built in logging but I've heard so many times on the forum that a solution for someone's problem wouldn't work because it involved writing info to a file, I've decided the solution to this problem can't involve writing any info to a file. I could insert messages into the scripts but I've experienced times where sending a message using the built in message> function has stolen focus from a window and caused issues, so I can't use any Macro Scheduler or VBScipt message functions.
I've decided the only way to make this work is to add a dialog to the master script and have the subordinate scripts update the dialog as they progress.
The goal for this week's puzzler is for you to come up with a master script that can do this. The master script's dialog needs to display whatever information a subordinate script sends to it, on a label. No information can be saved to a file nor can we use the clipboard. The master script should be able to fire off an unlimited number of scripts and the scripts should process sequentially. One script does not start until the previous script has ended. For puzzler contest continuity (and to make it easier for me to check the results), the master script should run the following script using three different names. The three script names should be puzzler1.scp, puzzler2.scp and puzzler3.scp. The only part of this code you will need to modify is wherever it says, "Send this message to a dialog"
To encapsulate.
- Put the following code in each of three different scripts modifying the send message lines.
- Write a master script that fires the three scripts sequentially and one at a time.
- The master script will display a dialog and in the dialog a label will display messages from the three scripts.
- Can't write anything to a file.
- Can't use the clipboard.
- Can't use any messages other than the master script's dialog.
Code: Select all
StringReplace>script_file,%script_dir%\,,script_file
Let>kk=0
Label>Loop
Add>kk,1
Let>RP_WAIT=1
Let>RP_Windowmode=0
RunProgram>cmd /c ping 127.0.0.1 -n 1
//Send this message to a dialog Ping number %kk%
If>kk>4
Wait>1
//Send this message to a dialog %script_file% Complete
Exit>0
EndIf
Wait>1
Goto>Loop