Bytales wrote:
but what are those:
Code:
(A_Now > A_Year A_Mon A_MDay startTime) && (A_Now < A_Year A_Mon A_MDay stopTime) && !alreadyRan
"A_xxx" are AHK built-in variables. They are listed in the help file on this
pageHere is the basic idea:
Code:
; get time window start/end in standard format
startTime = 1435 ; your window start time HHSS
endTime = 1455 ; your window end time HHSS
sTime := A_Year A_Mon A_MDay startTime 00 ; set start time in YYYYMMDD24HHMMSS format
eTime := A_Year A_Mon A_MDay endTime 00 ; set end time in YYYYMMDD24HHMMSS format
;
; your code here
loop, { ; loop until we are in time window
nTime := A_Now ; get current time in YYYYMMDD24HHMMSS format
if (nTime > sTime) && (nTime < eTime) {
break
}
sleep, 0.250 ; check current time every .25 seconds
}
; Run, YOUR_COMMAND
This is only one way to do this. Depending on your application you may want to use SetTimer to periodically check the current time, but it all depends on the exact need,