Re: A daily script
Re: A daily script
- Subject: Re: A daily script
- From: Ed Stockly <email@hidden>
- Date: Wed, 20 Dec 2000 12:20:50 -0800
>
At 12:29 +0100 20/12/00, Ken Mcgregor wrote:
>
> I need to run a script at a set time each day.
>
>
>
> I am stuck between either writing an idle script that rests for a perid then
>
> checks the time. (current hour)
>
> or whether to use something like Cron.
>
>
>
> It will be run on a dedicated Mac.
>
>
>
> Any advice gratefully received
The simplest solution, not requiring any third party software is to do this
from within an idle handler.
However, rather than rest for a period and then check the time, I suggest
calculating the time difference and idling for the number of seconds until
the script is needed to run:
on idle
set timetoAct to "2:00 am"
set interval to (date timetoAct) - (current date)
return interval
end idle
HTH,
ES
When on the net visit: <
http://justapplescript.weblogs.com/>