I need to enable computer to go to sleep behind Screensaver which asks

I need to enable computer to go to sleep behind Screensaver which asks for password.

I was able to simply run a simple Script:

tell application “Finder”
sleep
end tell

But since the June 8th Security Update, the script no longer works

This is when my ScreenSaver is running and asks for a password to get back to computer.

The script DOES work when there’s no screensaver running

Any help is greatly appreciated! I am checking the thread every 5 minutes :slight_smile:

try

tell application "System Events"
sleep 
end tell

Nope, no go :frowning:

It works (just like the other one) but not from behind the screensaver

Interestingly, if I set the schedule in System Preferences to sleep the computer – it works fine behind the running locked Screensaver (by “locked” I mean the one that requires a password to dismiss)

Macfixit seems to deal with this issue, but I am not a subscriber.

Here’s the link:

This is what Google came up with as a description for the above link:

“This could be used to launch an application behind a locked screensaver window. … Mac OS X 10.4.1: Release Notes, difference between Software…”

All it says is:

and

Which basically means you can’t do what you want anymore. It was a pretty big security hole.

Wow! So I know I wasn’t going insane ” they actually did remove that ability!

Can anyone think of any way for me to get this ability back through a hack of some sort?

Any help is much appreciated

Interestingly, SOME scripts DO run behind the locked screensaver (as I already mentioned above) ” for instance, my “force-quit WMP script.”

Can I possibly write a script to, in effect, force the System to sleep behind the locked Screensaver? I am losing hope though…

Well, I can think of one theoretical solution but I am not sure if I can implement it:

A third-party application could possibly be written to allow for more sleep options in the Schedule pane in OS X’s System Preferences.
As I already mentioned above, the sleep function generated by Sys Prefs does work behind the locked screensaver. I really need only a couple of more times to sleep the computer during the day.

Or maybe I can schedule a command via Cronnix or PiTime such as:

sleep -r now

Would this command theoretically work?

The commnand to reboot is shutdown -r now

And to shutdown is: shutdown -h now

Any help?

What’s the right command?

I did a command in the Terminal:

man shutdown

and a Menu came up that tells me all the available option, and a sleep option wasn’t one of them. I had shutddown -h, shutdown -r, and a couple of others. So I guess “sleep” wasn’t one of the options.

Basically, here:

SYNOPSIS
shutdown [-] [-h | -r | -k] [-o [-n]] time [warning-message …]

DESCRIPTION
The shutdown utility provides an automated shutdown procedure for super-
users to nicely notify users when the system is shutting down, saving
them from system administrators, hackers, and gurus, who would otherwise
not bother with such niceties.

 The following options are available:

 -h      The system is halted at the specified time.

 -r      The system is rebooted at the specified time.

 -k      Kick everybody off.  The -k option does not actually halt the
         system, but leaves the system multi-user with logins disabled
         (for all but super-user).

 -o      If one of the -h, -p or -r is specified, shutdown will execute
         halt(8) or reboot(8) instead of sending signal to init(8).

 -n      If the -o is specified, prevent the file system cache from being
         flushed by passing -n option to halt(8) or reboot(8).  This
         option should probably not be used.

 time    Time is the time at which shutdown will bring the system down and
         may be the word now (indicating an immediate shutdown) or specify
         a future time in one of two formats: +number, or yymmddhhmm,
         where the year, month, and day may be defaulted to the current
         system values.  The first form brings the system down in number
         minutes and the second at the absolute time specified.

 warning-message
         Any other arguments comprise the warning message that is broad-
         cast to users currently logged into the system.

:

Can you open applications via applescript? Because if you can, then maybe you can open an app that contains the sleep code?

You may want to try:

http://wdb.apple.com/downloads/macosx/unix_open_source/sleepwatcher.html