Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run macro at scheduled repeated time
#1
Hello,
help please !!!

I need to run a macro that copy a file at a scheduled time.
I have no problem for make the macro with "cop" command but I need to
run the macro at exact time refering the PC clock.

The time is 10 seconds after the start of every minutes.

This some examples (from clock PC time):
00:00:00 ..... I click the run  command
wait till
00:00:10 .... execute the copy of the file

01:05:42 ... I click the run command
wait till
01:06:10 .... execute the copy of the file

08:32:15 .... I click the run command
wait till
08:33:10 .... execute the copy of the file

13:15:02 ... I click the run command
wait till
13:15:10 ...execute the copy of the file

21:07:10 .... I click the run command (note: click at the exact 10 second)
wait till
21:08:10 ...... execute the copy of the file

The problem I am not able to solve is that the time must be syncronized with
the clock of the computer.... So, I would like to run the macro at any time but, finally, must start to make the copy
only at the right time as above example (10 second after the start of each minutes refering the internat PC clock)

So, the trigger of the macro must read the PC clock and run accordly.

Appreciated your help !

Thanks in advance !
#2
Macro Macro3195
Code:
Copy      Help
DateTime now.FromComputerTime t=now
SYSTEMTIME k=t.ToSYSTEMTIME
if(k.wSecond>=10) t.AddParts(0 0 1); k=t.ToSYSTEMTIME
k.wSecond=10
t.FromSYSTEMTIME(k)
out F"now={now.ToStr(4)}  run={t.ToStr(4)}" ;;disable this line
double after=(t-now)/10000000.0
out after ;;disable this line
wait after
mes "MACRO"
#3
Hi Gintaras
Just tested your macro and work perfectly.
Thank you very much for your appreciated help !

Have a nice week end.


Forum Jump:


Users browsing this thread: 2 Guest(s)