Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trigger by Clock Time
#1
I am trying to set up a macro that will run on the user-selected choice of every "x" minutes or hours or alternatively "on the hour" or "on the half-hour".
The first one I think I can do using this:

Gintaras Wrote:Function notepad_timer
Trigger: !cv"* - Notepad" "Notepad" "" "" "" 0x6
Code:
Copy      Help
;\
int hwnd=val(_command)
int i h m s; str ss
for i 0 1000000000
,if(!IsWindow(hwnd)) ret
,ss.getwintext(hwnd)
,if(i) ss.replacerx(" <\d+:\d+:\d+>$") ;;remove previous timer
,s=i%60
,m=i/60%60
,h=i/3600
,ss.formata(" <%i:%02i:%02i>" h m s)
,ss.setwintext(hwnd)
,1
err+

But for on the hour or half hour (i.e. 2 pm, 3pm, 4 pm or 2:30, 3:30, 4:30 etc), would the only way be to get the current time, figure out the number of seconds to the next time mark, trigger after that and then every hour's worth of seconds after that repeatedly?

Thanks... not necessarily asking anyone to take the time to do the code for me :oops: but just want to know if my strategy makes sense or if there is a much easier way.

Thanks,
Stuart
#2
script to Create a Scheduled Task
#3
Super Duper as always, Gintaras!. Thanks so much, Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)