Random collection of AppleScripts that I find to be helpful.
Sets the audio input to the internal mic when headphones are connected to the machine. This is handy as I find that Macs come with better built-in microphones than most headphones and it's a hassle to configure the audio input every time a headphone is paired.