Here is a script I had alot of trouble with, so I will share it so someone else might find it useful.
Setup a file in the config directory called holidays.txt
it should contain lines that have the date of your holidays
like:
1/1/2010
1/18/2010
5/31/2010
7/5/2010
9/6/2010
10/11/2010
11/11/2010
12/24/2010
Then, in your script where you want to know if today is a holiday, put the following:
' Get Check to see if today is a holiday ((holidays.txt in Config Folder)
if (hs.runex("isholiday.txt","Is_Holiday","test")) = "FALSE" then
'Run the script, otherwise dont run it because today is a holiday.
..do some stuff if today is not a holiday
end if
The Is_holiday.txt script needs to be in the scripts folder.
have fun. This is also a good example of how to call one script from another and pass back a return value.
-Scott
Setup a file in the config directory called holidays.txt
it should contain lines that have the date of your holidays
like:
1/1/2010
1/18/2010
5/31/2010
7/5/2010
9/6/2010
10/11/2010
11/11/2010
12/24/2010
Then, in your script where you want to know if today is a holiday, put the following:
' Get Check to see if today is a holiday ((holidays.txt in Config Folder)
if (hs.runex("isholiday.txt","Is_Holiday","test")) = "FALSE" then
'Run the script, otherwise dont run it because today is a holiday.
..do some stuff if today is not a holiday
end if
The Is_holiday.txt script needs to be in the scripts folder.
have fun. This is also a good example of how to call one script from another and pass back a return value.
-Scott
Comment