Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

<<kiuScheduler>>: schedule your tasks quickly


  • Please log in to reply
9 replies to this topic
kiu
  • Members
  • 234 posts
  • Last active: Oct 10 2010 07:30 PM
  • Joined: 18 Dec 2005
This is a script to make your tasks run at a specified time.
For you that can't live without a gui, this pack contain a standalone version with a gui and personalized icons too, useful for everyday use:
https://ahknet.autoh...u/scheduler.zip


This is the script:

;author: Salvatore Agostino Romeo
#Persistent
#SingleInstance force
IniRead, numberOfItem, scheduler.ini, init, noi, 5
noi:=numberOfItem
Loop,%noi% ;get values from .ini
{
	IniRead,itemName%A_Index%,scheduler.ini,item%A_Index%,name
	IniRead,itemDay%A_Index%,scheduler.ini,item%A_Index%,day
	IniRead,itemHour%A_Index%,scheduler.ini,item%A_Index%,hour
	IniRead,itemMin%A_Index%,scheduler.ini,item%A_Index%,min
	IniRead,itemRun%A_Index%,scheduler.ini,item%A_Index%,run
}
SetTimer,schedule,59000
return

schedule:
Loop,%noi%
    if(itemHour%A_Index%=A_HOUR and itemMin%A_Index%=A_MIN 
				and (itemDay%A_Index%=A_DDD or  itemDay%A_Index%="all" 
				or itemDay%A_Index%=A_DD or itemDay%A_Index%="Today"))
    	run,% itemRun%A_Index%
return
esc::
exitapp

An example of the scheduler.ini file:
[init]
noi=1
[item1]
name=example
day=Ven
hour=18
min=42
run=c:\

____________________
______________________
kiu - www.romeosa.com

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
This is one of only a few scheduling scripts I've seen posted. Thanks for sharing it.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
I'd been waiting for this item on the Planned Features list before making a scheduling script :wink:
"Add scheduling by extending SetTimer, e.g. daily at a certain time, etc."

I'm getting by with another reminder/scheduler program at the moment but AHK has a lot of potential for replacing it, it'd just be easier/neater with that new feature.

yitzle
  • Members
  • 1 posts
  • Last active: Jul 14 2006 07:28 PM
  • Joined: 14 Jul 2006
Thanks!!

Haku
  • Members
  • 2 posts
  • Last active: Feb 23 2007 10:43 PM
  • Joined: 17 Feb 2007
My ADSL provider has contacted me saying I'm using too much, this is on an "unlimited" package... so rudimentary bandwidth management is now a must.

I need a program that can start program(s) and most importantly stop program(s) at certain times of the day on a weekly schedule, so the downloading programs only run during off-peak times which differ at the weekeend.

This script looks like an ideal starting point, how can I modify it so it also has a "close program" function and can differentiate between weekdays and weekends?


Thanks for any help.

Haku
  • Members
  • 2 posts
  • Last active: Feb 23 2007 10:43 PM
  • Joined: 17 Feb 2007
I had a stab at altering it so I can make it run programs & close windows:

;author: Salvatore Agostino Romeo
#Persistent
#SingleInstance force
IniRead, numberOfItem, scheduler.ini, init, noi, 6
noi:=numberOfItem
Loop,%noi% ;get values from .ini
{
   IniRead,itemName%A_Index%,scheduler.ini,item%A_Index%,name
   IniRead,itemDay%A_Index%,scheduler.ini,item%A_Index%,day
   IniRead,itemHour%A_Index%,scheduler.ini,item%A_Index%,hour
   IniRead,itemMin%A_Index%,scheduler.ini,item%A_Index%,min
   IniRead,itemCommand%A_Index%,scheduler.ini,item%A_Index%,command
   IniRead,itemProgram%A_Index%,scheduler.ini,item%A_Index%,program
}
SetTimer,schedule,59000
return

schedule:
Loop,%noi%
    if(itemHour%A_Index%=A_HOUR and itemMin%A_Index%=A_MIN
            and (itemDay%A_Index%=A_DDD or  itemDay%A_Index%="all"
            or itemDay%A_Index%=A_DD or itemDay%A_Index%="Today"))
       if(itemCommand%A_Index%="run")
          run,% itemProgram%A_Index%
       else
          if(itemCommand%A_Index%="close")
             WinClose,% itemProgram%A_Index%
return
esc::
exitapp



And an example config script which runs Notepad then closes it a minute later:

[init]
noi=2
[item1]
name=Run Notepad
day=all
hour=8
min=11
command=run
program=notepad
[item2]
name=Close Notepad
day=all
hour=8
min=12
command=close
program=Untitled - Notepad


Works for me, now to fine tune the config script to do different times on different days.


Something that I noticed while testing the script is the 59 seconds wait loop, does it mean there's the possibility of having the run or close command executed twice in one minute?

lingamsandeep
  • Guests
  • Last active:
  • Joined: --
Hi,
I am looking for a script or a way to invoke a certain set of actions which can be invoked eventhough the display is locked. Is there a way to do that ?

The actions involve invoking a desktop program and sending keys to it to run something.

Any help is greatly appreciated

Grumpy
  • Guests
  • Last active:
  • Joined: --
You already asked that in the Ask for Help section!
http://www.autohotke...pic.php?t=17238

cacabuda
  • Members
  • 3 posts
  • Last active: Mar 22 2007 01:03 PM
  • Joined: 22 Mar 2007
Hello,

I would like to modify the ini file for scheduling keystroke...
What i want is to start and end a TV record at scheduled time from the program Pouchin TV.
For that i need to schedule :
a Ctrl+t for the begining of the record
a Ctrl+Enter for the end of the record
Can someone help me?

Thanks!

cacabuda
  • Members
  • 3 posts
  • Last active: Mar 22 2007 01:03 PM
  • Joined: 22 Mar 2007
Hello twice,

Well i found what was wrong in my exe file. The ahk file should be before compiling to exe like that :

WinWait, Pouchin TV,
IfWinNotActive, Pouchin TV, , WinActivate, Pouchin TV,
WinWaitActive, Pouchin TV,
Send, {CTRLDOWN}t{CTRLUP}

The same for Ctrl+Enter, replacing last line by :
Send, {CTRLDOWN}{ENTER}{CTRLUP}