AppleScript to prepare your laptop for a presentation
Summary: Here is a little AppleScript that you can use to prepare your laptop before starting a presentation (e.g., mute volume, switch off unnecessary programs, etc.). You can easily extent and adapt it.
Presentation routine
If you are like me, you want to make sure everything is prepared before giving a talk. I have a checklist I go through before every presentation including to test the setup, to switch off my mobile phone, to make sure my extra pack of batteries for my remote are close by, and to switch off unnecessary applications. For the last one I have written a small AppleScript that does that automatically and I even implemented a corresponding Alfred 2 workflow.
The script switches off all applications that are running in the background (Dropbox, Hazel, etc. ) or that display information that I don't want to share accidentally with people (e.g., Mail and Omnifocus). In addition, I switch the volume to mute. Clearly, you should do that only if you will not use audio for your presentation. I also start Caffeine to avoid any black screens during my presentation. Hazel is a special case as it does not run as an application. The Hazel guys helped me here with a piece of code, which basically looks for the process named "HazelHelper" in the list of running processes, gets the corresponding process ID, and stops it.
Tip: I suggest you switch off also any notification. Go to Preferences / Notifications and check the box for "when mirroring to TVs and projectors."
Adapting the script for your needs
You can easily adapt the scripts for your needs. Simply add the line
tell application "APPNAME" to quit
If you are not sure about the exact APPNAME, start "Activity Monitor" (e.g. by searching it with Spotlight) and look up the "Process Name" (first column) in the list of running processes.
After the presentation
I have also written a script to start the applications again after the presentation. It switches the audio volume back on and kills Caffeine. Of course you can adapt it as easily as the first one.
Enjoy and let me know if it was helpful or if you have any suggestion for improvement.
Work smart, be remarkable, and have a great day!
Helmut