PowerBlock The AppleScript can optionally run an AppleScript and intercepts the power button presses. This is useful on the MacBook Air, where the power button can be accidentally pressed.
You can set up your system to automatically shut down, restart, sleep, eject or wake up by running an AppleScript whenever the power button is pressed. This is great for headless server.
Limitations: PowerBlock cannot prevent a hard shut down if you hold the power key for more than four seconds.
Version 1.2:
Powerblock is not compatible with OS X 10.9 due to changes in the power system.