If your only Mac is a laptop, and you take it with you to meetings, classes, or other such activities, you're probably used to muting your machine before the event starts, then unmuting it once the event ends. While this is clearly not hard to do, it can be somewhat embarrassing if you forget to mute your Mac, only to have it loudly announce the arrival of a new e-mail, Tweet, or iChat message during the middle of a lecture.
Using a very simple set of scripts based on a submission by Mac OS X Hints reader Andrew J. Freyer, you can greatly reduce the chances of an audio outburst during your regularly-scheduled activities, as long as you've scheduled those activities in iCal. Here's how to do it. First, you need to create two simple one-line AppleScripts.
Launch AppleScript Editor in 10.6 (in Applications -> Utilities) or Script Editor in 10.5 (in Applications -> AppleScript), then copy and paste this line:
set volume with output muted
Save this as sound_mute (or whatever you'd like), with the File Format pop-up menu (in the Save dialog) set to Script. Save it somewhere where you won't accidentally delete it. Create a new script in Script Editor (Command-N), and then paste in this command:
set volume without output muted
Save this one as sound_unmute, again with the File Format pop-up menu set to Script.
Once you've saved both scripts, go to iCal, and select one of your recurring events, then press Command-E to edit that event. Add an alarm to the event, and set the pop-up to Run Script. Then click the line below Run Script, and navigate to your saved copy of sound_mute.
Set the alarm to activate one minute (or more, based on when you arrive for the event) before the event. Add another alarm, but set this one to run the sound_unmute script, at one minute after the event ends.
Repeat this process for each event for which you'd like to mute your Mac's sound, and you'll never have to remember to do it yourself. To further protect yourself, in case you bump one of your keyboard's audio keys, visit the Sound Effects tab of the Sound System Preferences panel, and make sure the Play Feedback When Volume is Changed option is not enabled.
These scripts work great if you've got just your one laptop Mac. But what if you own more than one Mac and use MobileMe to sync information between the machines? In that case, the copies of the events on the other Macs will generate errors, because they won't be able to find the alarm scripts. One possible solution is to store the scripts on your iDisk, which should make them accessible to all your Macs (I haven't tested this, though). Another possible solution is to keep your scripts in sync between Macs, using a program like DropBox.
This story, "Automatically Mute Sound Before Meetings" was originally published by Macworld.