The code below does everything I want, except display that the script is still running (timer is set to 2 hours and can loop a number of times). I've added a message>LoopCount (which works), my problem is that the window interrupts the script until the ok button is clicked.
Any suggestions are welcome.
Code: Select all
//Delete Output Files
DeleteFile>C:\Users\Output\Estimates_a\*.*
DeleteFile>C:\Users\Output\Estimates_b\*.*
//Set Script Variables
Let>loopcounter=0
Let>Missing=Missing:%CRLF%
//Loop Counter
Repeat>loopcounter
Let>loopcounter=loopcounter+1
//Exit Script If ALL Files Exist,
IfFileExists>C:\Users\Output\Estimates_a\Estimates a_data,,Skip
IfFileExists>C:\Users\Output\Estimates_b\Estimates b_data,,Skip
Exit>0
Label>Skip
?????????????????????????????????????????????????????
IfWindowOpen>Macro Scheduler Message
CloseWindow>Macro Scheduler Message
else
//Do nothing
endif>
Message>Loop Count = %loopcounter% of 4%CRLF%Loop Time = 2 hours
??????????????????????????????????????????????????????
IfFileExists>C:\Users\Output\Estimates_a\Estimates a_data.xls
//Do nothing
else
Let>Missing=%Missing%(%loopcounter%)Estimates a %CRLF%
run>"C:\Program Files\RunProject.exe" "C:\Users\Estimates a.rip"
endif>
IfFileExists>C:\Users\Output\Estimates_b\Estimates b_data.xls
//Do nothing
else
Let>Missing=%Missing%(%loopcounter%)Estimates b %CRLF%
run>"C:\Program Files\RunProject.exe" "C:\Users\Estimates b.rip"
endif>
//Pause Loop <<<<Set>7200
//Kill RunProject
VBSTART
set wmi = getobject("winmgmts:")
sQuery = "select * from win32_process where name = 'RunProject.exe'"
set processes = wmi.execquery(sQuery)
for each process in processes
process.terminate
next
VBEND
//Loop Script "n" Times <<<<Set>loopcounter>3
//On File Exists Error > 1; Save Log File
Let>LogFile=C:\Users\Log\Log.txt
GetDate>vToday
Timestamp>LogFile,%vToday%, %Missing%
k