I wrote a post a while back about the pesky habit of my MacBook Pro trying to make me go deaf. I plug my laptop into a stereo via the headphone jack at home and listen to music. In order to get the sound levels right at home, I increase the volume to full volume (otherwise I have to turn up the stereo and I get lots of noise and hum). When I leave in the morning, I unplug my laptop and the MacBook resets its volume to the pre-headphone jack volume. Fine. Unfortunately, when I get to work, I plug-in my headphones, start checking email, hit my keyboard command for iTunes play, and proceed to deafen myself with full volume, as the machine automatically resets the system volume to the previous headphone jack volume level.
Today I deafened myself, but upon searching, discovered Alloc Init, which features a nice little app called Breakaway. The main feature of this app is to pause iTunes or launch the screensaver when the headphone jack status is changed (plugged in or out). However, the nicer thing about the app is that it also allows the user to trigger an applescript on the same events. I created the following script called setVolumeTo20of100:
tell application "Finder"<br />
set volume output volume 20<br />
end tell
After creating a custom trigger in Breakaway, my system volume will always be reset to 20 when I plug in something to the headphone jack. Since I don’t care about having to increase the volume at home automatically, this is fine for now, since I will most importantly not deafen myself in the morning at work. I will perhaps post an update later that checks the the network preferences for the current location for setting the volume automatically based on location, which will automate things a little more. Meanwhile, I highly recommend this nice little app. (Note: the interface for creating custom triggers is a little clunky, so you may have to play with it a little first, but it does work — just be patient.)