Jump to content
Sign in to follow this  

Run Function between certain times at a certain day repeatedly

Recommended Posts


Hello Folks,


I would like to run a function at certain times and on a certain day. But I cant figure out how. The script shall run repeatedly every 60 seconds. Here is my very best try:


#include <Date.au3>  ;  1 = Sun  2 = Mon  3 = Tue  4 = Wed  5 = Thu  6 = Fri  7 = Sat

$StartTime = "09:00"
$EndTime   = "19:00"
$CurrentTime = _NowTime(4)

Switch @WDAY
Case 1,2,3,4,5,6,7
    If $CurrentTime >= $StartTime AND $CurrentTime <= $EndTime Then
        While 1


Edited by error471

Share this post

Link to post
Share on other sites

It works now, I made a quite noobish mistake.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.