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


Click here to return to the 'Temporarily prevent sleep, screen saver activation, etc.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Temporarily prevent sleep, screen saver activation, etc.
Authored by: talltree1008 on Aug 07, '07 07:13:31AM

Ii is easy to use applescript to do this. I may have gotten the idea for this from a hint posted here, I don't remember.

This will disable display sleep and computer sleep:

do shell script "sudo pmset displaysleep 0 sleep 0" password "your password" with administrator privileges

The arguments for sleep and displaysleep are minutes. This will set display sleep to 5 minutes, and computer sleep to 30 minutes:

do shell script "sudo pmset displaysleep 5 sleep 30" password "your password" with administrator privileges

Saving these in your scripts folder will make them available in your scripts menu, making them easily accessible at any time.



[ Reply to This | # ]
Temporarily prevent sleep, screen saver activation, etc.
Authored by: bbell2000 on May 29, '09 02:20:47PM

Hmmm. Is there anyway I could make this scripting thing work in conjunction with Screen Sharing?

I often use screen sharing to access my MacBook Pro from another room. The problem is that Screen Sharing completely corrupts the screen on my iMac if the MacBook has gone to sleep.

I've been trying to use WakeOnLan to wake up the MacBook when this happens, but if I could do a script that disables sleep when Screen Sharing is connected on the MacBook, it would be so much nicer.



[ Reply to This | # ]