Mac app for automatically closing / opening certain apps according to profiles? I am looking for a app that allows me to set profiles consisting of apps to close or open on profile change. 

Example. The following processes are currently open


Dropbox
Chrome
Foo
Bar


After activating "cafe profile" 


Chrome
Bar
Terminal


Background: I work in cafes a lot. Most of the times, I forget to turn off dropbox, hangouts, and other background processes which drains battery. Upon realizing, I close everything from the process manager, but if I had a app which does that automatically, that would save me a lot of time. 

I plan to write it myself but want to make sure it doesn't exist yet before doing doubled work.
If you are willing to pay some money for it there is the excellent Keyboard Maestro which can do a lot of things. There you can close and open Apps easily.

If you do not want to spend money I suggest you take some time to learn Apple Script. This is a free scripting language provided by Apple. Alternatively you can use shell scripts but I am not so sure if you can easily check which apps are running or not.