Re: Is there a "wake up" detector?
Re: Is there a "wake up" detector?
- Subject: Re: Is there a "wake up" detector?
- From: vectormation <email@hidden>
- Date: Mon, 1 Oct 2001 15:25:59 -0400
wake up the script more often - say once a minute - and get the time
until the next event (whole hour) If the interval is less than a minute -
wake again on the interval, else wake again in a minute... At worst, you
lose one event in the case where the script is awakened less than a
minute from the event.
Yes it's brutish, but even MacOS X isnt a RTOS - so it's hard to expect
AppleScript to be able to perform RTOS-like functions elegantly. The
cron-like applications as triggers for your scripts are better solutions.
See Bill Cheeseman's site for details.
~Phi
>
> Date: Mon, 01 Oct 2001 00:07:01 -0700
>
> Subject: Re: Is there a "wake up" detector?
>
> From: Paul Berkowitz <email@hidden>
>
> To: Applescript-Users <email@hidden>
>
>
>
> Why don't you use Akua Sweets to get 'the clock' when the idle handler runs
>
> and reset your time accordingly?
>
>
>
> --
>
> Paul Berkowitz
>
>
>
> > From: "Marc K. Myers" <email@hidden>
>
> > Organization: [very little]
>
> > Reply-To: email@hidden
>
> > Date: Mon, 01 Oct 2001 02:23:20 -0400
>
> > To: applescript-users <email@hidden>
>
> > Subject: Is there a "wake up" detector?
>
> >
>
> > I have a script with an idle handler that speaks the time to me at a
>
> > settable interval (on the hour, on the half hour, on the quarter hour,
>
> > etc.) and it works quite well UNLESS I put the machine to sleep.
>
> > Apparently the "clock" the system uses to wake up an idled script stops
>
> > along with everything else when you sleep the machine. When it wakes up
>
> > again the countdown picks up where it left off, but now it's pointed
>
> > towards the wrong time.
>
> >
>
> > Is there any sort of Apple Event that gets sent when a machine wakes up
>
> > that could be used to trigger a handler in an idled script? And, once
>
> > an idle handler has issued a return is there anyway to stop it from
>
> > running again after the number of seconds in the return statement? I'd
>
> > like to cancel the next execution of the idle handler and reset it to
>
> > "go off" at the next exact interval.
>
> >
>
> > When the idle handler is activated I can check to see if the current
>
> > date is greater than the set date and if it is reset for the next proper
>
> > interval, but this causes the script to miss the first interval after
>
> > the waking from sleep. If waking from sleep could trigger something in
>
> > the script (and I could cancel the next execution of the run handler)
>
> > then I could catch the first exact interval after the machine wakes up.
>
>
I'm already testing to see if the current time is greater than the set
>
time (nextStart). That prevents getting an erroneous time read-out and
>
sets up for the next proper exact interval. The problem I'm trying to
>
work around is that after a sleep period the idle handler always
>
activates after its assigned alert time so I always lose the first alert
>
after a sleep. That's where some kind of script-detectable signal from
>
waking up would come in handy.
>
>
Marc K. Myers <email@hidden>
>
http://AppleScriptsToGo.com
>
4020 W.220th St.
>
Fairview Park, OH 44126
>
(440) 331-1074
>
>
[10/1/01 11:06:08 AM]
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users