Change Power Management Settings

Hi all…

I’m very new to writing Applescript and before trying to do this one myself I was wondering if anyone had already put a script together to cover this function / or I could get some advice.

Basic requirements are :

I have a 200GB+ iTunes Library with 75% of the data being videos. I have an Apple TV and choose to stream my video from my main computer (MacBook Pro) to the device. I current have my power management setting to ‘Better Energy Savings’ so after about 15 mins my MacBook will go to sleep.

While I stream a movie (.mp4 file type) my MacBook doesn’t seem to go into sleep, but when I stream TV shows (converted with QT into .m4v) at the correct time my MacBook will go to sleep, causing me to lose stream while watching my programs.

To get around the problem I am manually changing my power management settings to ‘Never’ sleep while I watch my TV shows, then I change it back to ‘Better Energy Savings’ after…

Is there a script out there that can automate this process, so I can simply run a script (app) from my menu bar rather than having to enter system preferences each time ?


  • Neil


you can change the idle time until the computer sleeps with

do shell script "/usr/sbin/systemsetup -setcomputersleep Never" password "¢¢¢¢" with administrator privileges

instead of Never you can also use a numeric value measured in minutes.
Administrator privileges are required.

If you run Tiger on your computer you have to use pmset instead

do shell script "/usr/bin/pmset -a sleep 0" password "¢¢¢¢" with administrator privileges