Here is a little program that will automatically toggle between two different plugged in power settings. I will use this when watching videos and I don't want the screen to go to sleep. Further info on the pmset command can be found here:
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/pmset.1.html set curset to do shell script "pmset -g" user name "your name" password "password" with administrator privileges
set curset to paragraph 5 of curset
if curset ends with 0 then
do shell script "pmset -c displaysleep 3 disksleep 10 sleep 13 halfdim 1" user name "your name" password "your password" with administrator privileges
else
do shell script "pmset -c displaysleep 0 disksleep 0 sleep 0 halfdim 0" user name "your name" password "password" with administrator privileges
end if