Cancel sleep

Hi all,

This is my first post. I’ve been a Mac user for many years, but never did anything with Applescript. But I think this is about to change.

Is there a way to keep my mac (iMac G3 500, 10.2.6) from going to sleep? No problem… just set Energy Saver to “Never Sleep”.

One problem… I have a two-year old (whom I love with all my heart) that receives great joy from pushing the power button on the iMac and saying, “Go night-night, bah-by”. He loves to see the screen go to black.

So after a little searching, I’ve found a program, Senario, from MacChampion.com that will activate applescripts upon certain activities that happen with the computer. One of them is sleep. It would seem that with Senario running, when the button on the front of the computer is pushed to start sleep mode, an applescript would be launched that would
automatically cancel the sleep or wake-up the computer immediately, thus nixing the computer will not go to sleep or only for a very short time (seconds).

If the above is true, does anyone know how to write an applescript that would do this? I’m familiar with a little perl, but not applescript. Or is it even neccasary to use a program like Senario?

Thanks for your help.

Mark