jack777
-
Posts
6 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by jack777
-
-
Hi,
I have a macro that is scheduled to run every minute, it executes a batch script and it takes sometimes more than 1 minute to complete. I don't want the macro to run again if it's already running. How can I achieve that ?
Related question : is there a way to wait for a command (the batch script) to terminate before continuing the macro ?
-
4 hours ago, rberq said:
Take a look at Cory's suggestion, though -- his is simpler to program. Execute the macro only once, so it does its thing then idles for the random time before doing its principle function again, generating a new random interval, and so on. You don't even have to intervene to start it running, just schedule it to run when Macro Express is started.
My thinking is kind of stuck at the Macro Express 3 level which doesn't allow for more than one macro to run at a time -- therefore I missed the option of having your macro run only once for a duration of many hours or even days. With ME3 if the macro runs continuously, then no other macros can run. With ME Pro a long-running macro doesn't block other macros from running.
I'm running Macro Express pro so more macros is not a problem for me. But I don't understand Cory's suggestion. Maybe because my English is limited...
-
Hi there !
I run a macro every minute.
If that macro hasn't finished it's work, will a new instance start 1 minute later or only when the first instance has finished it's job ?
Thanks for your help !
-
5 hours ago, rberq said:
Schedule your macro (with Macro Express) to run every 1 minute. Durin each run of the macro:
If "timer file" does not exist, generate a random number between 60 and 120 (because you want between 1 and 2 hours). Store the number in a text file ("timer file").
If "timer file" DOES exist, read it, decrement the number by 1, and check whether the number has reached zero. If not, store the new (decremented) number in "timer file" and exit from the macro without doing anything else. If time HAS reached zero, delete "timer file" and do whatever other stuff the macro is intended for. Because you have deleted "timer file", next time the macro runs 1 minute later the whole scheduling process will begin again.
If you have Macro Express run your macro every 5 minutes, instead of every 1 minutes, then the decrement described above would be 5, not 1. And so on -- since you have a fairly broad time range for your random runs, it is not really necessary to check "timer file" as often as every minute.
Somebody will probably embarrass me with a much simpler method, but that's all I have come up with for now.
Looks like a pretty nice solution ! Thank you very very much !!!!
-
Hi,
I'm wondering if it's possible to program a macro that would run at random intervals (every 1-2 hours on average).
Thanks for your feedback !
Have a nice day !
Run a macro every minute but don't run it if it's already running
in Macro Express and Macro Express Pro
Posted
Yes I already asked a similar question... Sorry. But I checked with examples. And I noticed the macro runs again every minute even if the previous instance didn't terminate... I will try your solution...