Trigger each hour

hendis

Member
How do I trigger a macro to run each hour EXACTLY on the hour? I don't think that using a "wait until next action" will work. To put it in different terms, I need to trigger a macro when the minutes equal 0 - and repeat this 8 times. I am doing a project at work that is expected to last several weeks. I need to perform a set of actions every hour on the hour.
 

hendis

Member
Thank you for answering so quickly, Jacob, but the interval trigger won't work either.
Let me explain. I need to perform a set of actions every hour on the hour. Sometimes, these actions will take 4 minutes, other times 16 minutes, and in extreme cases, more than half an hour. Regardless, I need to start my next set of actions exactly at the start of the next hour - or when the minutes equal zero. It doesn't matter how long the previous set took to perform. Setting up a one-hour delay is relatively simple, but it isn't what my boss wants.
 

Qarboz

Well-known member
You can try like that

Trigger
- Day/Time Trigger
(e.g.) 08:00 Mon-Fri
- Stopwatch
StpWtchTest: 1h 0m 0s

Actions
- Stopwatch (Reset and Restart)
StpWtchTest
- [your actions]
 

RSF

Well-known member
Or, as a sort of brute-force method, put 8 triggers on your macro (8am, 9am, 10am, 11am, etc.)
 

Abalsam

Active member
Thank you for answering so quickly, Jacob, but the interval trigger won't work either.
Let me explain. I need to perform a set of actions every hour on the hour. Sometimes, these actions will take 4 minutes, other times 16 minutes, and in extreme cases, more than half an hour. Regardless, I need to start my next set of actions exactly at the start of the next hour - or when the minutes equal zero. It doesn't matter how long the previous set took to perform. Setting up a one-hour delay is relatively simple, but it isn't what my boss wants.
Actually the interval trigger will work as it is configured to run at a given time (such as on the hour) and that next run time is scheduled at the start of the macro automatically. I tested this by creating a macro to run every 5 minutes using the interval trigger. I then had the macro wait (while running) for 6 minutes and looked at the logs.

If the interval would only kick off after the last run completed, I would only see logs of one instance running at a time.

I ended up seeing the next run scheduled for 5 minutes, then waiting 6 minutes, then the next interval starting as scheduled, then starting another 6 minute wait and then finally the first 6 minute wait ending.

If you would like, I can post a screen shot of the log.

In terms of limiting this to running 8 times a day, the best way to do it simply would be to add a constraint on the interval trigger that it should only fire between the daily start time and daily end time such as between 9am and 4pm

This proves interval works. Just set it for 1 hour on the # of minutes past the hour you prefer. One thing you have to keep in mind though is that if your process takes longer than 60 minutes to complete, using an interval may give you the process running twice at the same time (and they would share the same local variables which may complicate things).

I hope that helps
 
Last edited:

Dm114

Well-known member
How do I trigger a macro to run each hour EXACTLY on the hour? I don't think that using a "wait until next action" will work. To put it in different terms, I need to trigger a macro when the minutes equal 0 - and repeat this 8 times. I am doing a project at work that is expected to last several weeks. I need to perform a set of actions every hour on the hour.
 
Top