Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A helper script to enter SafeSleep on demand' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A helper script to enter SafeSleep on demand
Authored by: Anonymous on Nov 21, '05 08:02:44AM
A good hint. If you're using Secure Virtual Memory, the script needs a few changes:

do shell script "/usr/bin/sudo -k;/usr/bin/sudo /usr/bin/pmset -a hibernatemode 7; /usr/bin/sudo -k" password "_password_" with administrator privileges
ignoring application responses
	tell application "Finder" to sleep
	do shell script "(/bin/sleep 15 && /usr/bin/sudo -k && /usr/bin/sudo /usr/bin/pmset -a hibernatemode 5 && /usr/bin/sudo -k) &> /dev/null &" password "_password_" with administrator privileges
end ignoring
The difference is that '/usr/bin/pmset -a hibernatemode' in line 1 is set to 7, and /usr/bin/pmset -a hibernatemode' in line 4 is set to 5.

[robg adds: I added the div box to narrow the display down substantially. Also note the following comment, which indicates that the 7 and 5 need to be reversed if you use this script -- I did not, however, want to change the code, as I haven't tested it myself.]

[ Reply to This | # ]
It should be the 5 first time, THEN the 7! (NT)
Authored by: gabrielradic on Nov 22, '05 02:25:06PM

It should be the 5 first time, THEN the 7! (NT)

The above script got it the other way around, but it works well otherwise.



[ Reply to This | # ]
Works great ! half of the times
Authored by: Ludowan on Sep 20, '06 08:37:40PM

Hello!
the script works great on my PB G4 1.5GHz about half the times. The other half leaves the computer stuck during the 'wake up' process (progress bar does not 'progress' anymore at some varying stage). Sometimes it goes all through the wake up process, and when the screen comes back to its original state, gets stuck here (no mouse, no keyboard, no clock, nothing).
What is happening?

Also, what is the use of the "/bin/sleep 15" command? What does it do if I change it to 30, or to 0?
Thanks!



[ Reply to This | # ]