Scripts to quit and restore applications when you're going on and off battery on a laptop running OS X