View Single Post
Old 05-05-2005, 07:01 PM   #2
Bugbyte
Admin. Don't bug or I'll byte.
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Posts: 4,678
I checked into doing this via Applescript. Here's a response I got:

"Unfortunately, I don't think you can do this from AppleScript. However, there's still hope.
The Carbon framework enables you to implement a callback to catch and even halt sleep - which would then let you perform your shut down.
The Cocoa frameworks (AppKit's NSWorkspace class in particular) has a notification, NSWorkspaceWillSleepNotification, that can cause sleep to be suspended for up to 30 seconds. You may be able to begin a shut down during those 30 seconds."

I will look into the framework and see what else I can find out. If a small app can be written to do this, we only need run it on startup.

[Edit] Found this: "NSWorkspace now provides sleep notifications. NSWorkspaceWillSleepNotification and NSWorkspaceDidWakeNotification will be sent before the machine sleeps and after the machine wakes, respectively. An observer of NSWorkspaceWillSleepNotification can delay sleep for up to 30 seconds within the handling of the notification."

from here: http://developer.apple.com/releaseno...lderNotes.html

[Double Edit] Crap! I misspelled Mini in the thread title and it shows as "Mine". Changing it didn't fix it. Kandyman, can you fix it?
__________________
-Where in the world is the iBug?
-Find out about theiBug
-Attention Newbies! Have you seen the FAQ Emporium?
-No time to figure it out? Take 5 minutes to view the Car PC 101 video

Last edited by Bugbyte; 05-05-2005 at 09:29 PM.
Bugbyte is offline   Reply With Quote