wakeup signals in OS X
wakeup signals in OS X
- Subject: wakeup signals in OS X
- From: "Donald S. Hall" <email@hidden>
- Date: Fri, 15 Nov 2002 20:24:42 -0700
Hello all,
This is not specifically a Cocoa question, but I am sure there are people
with a lot more knowledge of OS X than I have reading this list, and maybe
one of you can help.
Someone posted the following in a Mac newsgroup last week:
>
> Hi, I want to write a shell script (or, if that won't cut it, an
>
> AppleScript or C program) which performs an action when my TiBook (OS
>
> X.2.1) wakes up from sleep.
>
>
Create a stay open Apple Script with the following code, adding yours
>
where the comment is. Note the guillemets around event pmgtwake. You
will
>
have to make sure it is always running. It works because Mac OS sends a
>
wake command to every running application when the Mac wakes.
>
on +event pmgtwake;
>
activate
>
-- place code here which will run when activated
>
end +event pmgtwake;
I want to do something similar, so I tried the following stay open
script application to test this out:
-- wake test------------
on +event pmgtwake;
activate
say "Waking Up!"
display dialog "Waking up!"
end +event pmgtwake;
on idle
return 1
end idle
-----------------------------
I put my computer (PM G4, OS 10.1.3, AS 1.8.1) to sleep from the Apple
menu, then after it had apparently gone to sleep, I pushed the power
button to wake it up. My application produced no output. Technote 1190
says that all applications that respond to higher level events receive
this event whenever the Mac is waking from sleep, but it seems my script
application did not. (Note that in the SIZE resource, "high level event
aware" is set to '1'.)
Does anyone know if this event is broadcast on wakeup in OS X? If not, can
anyone suggest another way that a program can determine when the processor
has awakened (or even come out of an idle state for that matter).
Thanks,
Don
p.s. + and ; are of course supposed to be the left and right guillemets (<<
and >>), but they don't show up in mail progams.
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
http://www.theboss.net/appsmore
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.