Turn Off Screen & Mute Sound

I leave my PowerBook running at night in my bedroom. I manually mute the sound, turn
the screen down until it is off, and turn off the backlit keyboard. How can I accomplish this same thing with an AppleScript?

Can we assume that you don’t want the PB to sleep for some reason? I think that does it all.

For muting your machine, one command will do it: set output muted to true. That doesn’t disturb your other settings. To turn the sound back on, you have to run set output muted to false.

Yes, I don’t want it to sleep. I just want the screen off (so the light doesn’t disturb my sleep). I also want to turn off the keyboard backlight.

I don’t know about the backlight, but if you look at the “Sleep” tab of the “Energy Saver” System Preferences pane, you’ll see that you can:

“Put the computer to sleep when it is inactive for:” — put the slider at Never; then check the box for putting the display to sleep at something like 15 minutes, and check the box to put hard disk(s) to slieep when possible.

In that configuration the processor will never sleep, but everything else will. If you mute the sound, all will be quiet and dark unless the CPU calls for disk action to do the system’s late night bidding.