Orderly shut down a Mac Mini with Power Button?
Can anyone think of a way to get a Mac Mini on OS 10.6 to perform orderly shut down when the power button is pressed briefly, the way a Macbook on OS 10.6 does?
In Energy Saver prefs, when I disable "Allow power button to put the computer to sleep" nothing happens when I press the power button.
The Mini will be in a headless setup, running software-based artwork. I need the gallery & collector to be able to shut it down by simply pressing the power button without a keyboard or mouse of any kind, not even wireless.
The computer will be hidden & inaccessible (except the power button). I can't shut down via remote access from another computer using SSH. It needs to work like a TV: Power button to turn on, power button to turn off.
Obviously a hard shut down every time could harm the system over time.
I made a simple Automator script to shut the machine down, and I even found a piece of freeware that remaps my script to the power button https://pqrs.org/macosx/keyremap4macbook... using this bypasses the "Are you sure you want to shut down the computer" dialog.
This all works fine & dandy on my Macbook-- I press the power button, it executes my shutdown script and bypasses the "Are you sure..." Voilà!
But when I use KeyRemap & my shutdown script on a Mac Mini, if my Energy Saver sleep pref is checked, it just sleeps. If the Energy Saver pref is unchecked, i get nothing at all— no response.
I've tested KeyRemapping my shut down script to other keys on the Mac Mini and it works great, so that's not the problem.
I've also checked the shutdown script and it does indeed shut down the Mac Mini when I execute it.
Maybe there's something I could add to my applescript to override the Mac Mini's sleep function (I'm no programmer) ?
Here's my applescript:
tell application "System Events"
Is this a good question?