AppleScript is a powerful scripting language for Mac OS X. It lets you to do cool things like control iTunes, launch applications and files, and even shut down your computer. A little known fact is that you can launch AppleScripts with MainStage. Here’s how you do it. AppleScripts can be assigned to any controller in MainStage via the Assignments & Mappings window. In the screenshot below, CC#85 is mapped to a screen control element named “Launch AppleScript”.

As you can see, it’s currently unmapped. In order to map the controller to an AppleScript, simply click on the assignment, in my case Ctrl 85 (85), and select the AppleScript you want to trigger in the Screen Control Inspector.

MainStage comes with a number of stock AppleScripts that are used to trigger various scriptable actions in iTunes. However, you can trigger your own AppleScripts as well. To do so, navigate to ~/Music/Audio Music Apps. In this directory, create a new folder called MainStage Scripts. AppleScripts placed in this folder will show up in MainStage.

One of my favorite uses of AppleScripts in MainStage is to initiate a shutdown sequence. My main gig is designing electronic music systems for Broadway shows. These shows almost always use a redundant rig with a KVM switch to toggle display and keyboard/mouse control between the two computers. I always map my shutdown AppleScript to a note on a MIDI keyboard, so a manual shutdown with the mouse isn’t necessary.