I have a drive with several thousand folders. The macro I've written opens the project files within each folder, makes various changes, saves the project to a new drive and then runs some checks on the new project files in other applications.
It does this by using a few different loops.
Loop A runs repeats the entire macro. It counts the number of folders on the drive and loops until A=count
Loops B & C run within Loop A and repeat other tasks, these loops count other things and continue until the loop = the respective counts.
The problem is that the amount of time it takes to run this macro on a drive due to the number of folders is quite considerable. I'd estimate 2-3 days. Therefore I'm wondering if there is a way to stop the macro and resume it where it left off at a different time?
I was thinking it could write to an .ini file /text file storing the loop number but I'm not entirely sure how that would work. I also need it to be able to complete its loop if it's stopped, rather than just stopping half way through a loop but I can't even begin to work out how to do that.
Is there a way of doing these things, or is there a better way of handling large tasks like this?
Pause and Resume a Macro?
Moderators: Dorian (MJT support), JRL
Re: Pause and Resume a Macro?
I'd use an OnEvent>key_down that goes to a subroutine that sets a flag variable. When the script is at a point where it can stop, test for the value of the flag variable. If the flag variable is set to pause, go to a modal message that says close this message to continue. Also reset the flag variable.
Let>Flag=0
OnEvent sets flag to 1
If>Flag=1
Let>Flag=0
MDL>press ok to continue
Endif
Let>Flag=0
OnEvent sets flag to 1
If>Flag=1
Let>Flag=0
MDL>press ok to continue
Endif
Re: Pause and Resume a Macro?
Hmm, that's an interesting idea and certainly one that I think could be the answer to making sure it completes a loop before exiting.
The only thing is that the more I think about it, due to the size of the job I think it will be necessary to stop the macro and resume where it left off on a different day. In other words, the computer needs to be able to be used for other things and turned off rather than waiting for someone to click to continue.
The only thing is that the more I think about it, due to the size of the job I think it will be necessary to stop the macro and resume where it left off on a different day. In other words, the computer needs to be able to be used for other things and turned off rather than waiting for someone to click to continue.