AutoHotkey Community

It is currently May 26th, 2012, 1:47 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 11th, 2008, 12:22 am 
Offline

Joined: December 10th, 2008, 11:41 pm
Posts: 5
Location: Anaheim
Ive been searching and cannot find out how to do this.

I have a script that I use to log the hours of my employees with an online program. I want to execute this script at 5:00PM Monday through Friday automatically.

How do I do that?

Code:
WinWait, Program Manager, FolderView
IfWinNotActive, Program Manager, FolderView, WinActivate, Program Manager, FolderView
WinWaitActive, Program Manager, FolderView
MouseClick, left,  1229,  20
MouseClick, left,  1229,  20
Sleep, 100
WinWait, Qqest Time and Attendance Systems - Mozilla Firefox,
IfWinNotActive, Qqest Time and Attendance Systems - Mozilla Firefox, , WinActivate, Qqest Time and Attendance Systems - Mozilla Firefox,
WinWaitActive, Qqest Time and Attendance Systems - Mozilla Firefox,
MouseClick, left,  796,  403
Sleep, 100
WinWait, Martin & Chapman Co. - Time Card - Mozilla Firefox,
IfWinNotActive, Martin & Chapman Co. - Time Card - Mozilla Firefox, , WinActivate, Martin & Chapman Co. - Time Card - Mozilla Firefox,
WinWaitActive, Martin & Chapman Co. - Time Card - Mozilla Firefox,
MouseClick, left,  1153,  139
Sleep, 100
WinWait, Qqest Time and Attendance Systems - Mozilla Firefox,
IfWinNotActive, Qqest Time and Attendance Systems - Mozilla Firefox, , WinActivate, Qqest Time and Attendance Systems - Mozilla Firefox,
WinWaitActive, Qqest Time and Attendance Systems - Mozilla Firefox,
MouseClick, left,  1268,  17
Sleep, 100


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 1:07 am 
Offline

Joined: December 8th, 2006, 5:17 am
Posts: 248
Location: Sydney Australia
this should get you started.

http://www.autohotkey.com/forum/viewtopic.php?t=32170

_________________
Paul O


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 2:13 pm 
Simple and easy:
Code:
loop {                           ; loop forever
  if A_WDay between 2 and 6            ; is day monday - friday?
  {
    if (A_Hour = 17) and (A_Min = 0)   ; is time 5:00 pm?
    GoSub, DailyTask               ; yes - do your daily task
  }
  sleep, 1000 * 60                  ; sleep for 60 seconds
}

DailyTask:
  ; whatever needs to be done
  return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 6:21 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
Assuming Windows XP, click Start...All Programs...Accessories...System Tools...Scheduled Tasks.

Add a new task. Set the time for 5pm and the days as M-F. Easy. :) I use this daily for a couple scripts that need to run at set times. What is good about this is that it does not leave the program running all day long waiting for the right time/day. I've found that any AHK program running takes up 4-8 MB. No point wasting the RAM when you don't need it.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 6:25 pm 
Offline

Joined: December 10th, 2008, 11:41 pm
Posts: 5
Location: Anaheim
The scheduled task did the job. Now I just need to perfect my script.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 7:04 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
Glad to hear that worked for you. Good luck on the script.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], patgenn123, poserpro and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group