Mute/unmute the sound

I absolutely love Mac OS X for that behind the cute facade there’s an even more beautiful thing called unix. Combine the power of unix shell with the cuteness of AppleScript and you can achieve pretty much anything. For example, to automatically mute the sound at night, just do the following:

  1. Start the Terminal

  2. Open crontab for editing using the following command:

    $ crontab -e

  3. Now copy these two lines into the editor:

    0 1 * * * osascript -e ‘tell application “System Events” to set volume with output muted’ 0 6 * * * osascript -e ‘tell application “System Events” to set volume without output muted’

  4. Save and quit and you’re done. This will mute the sound at 1:00AM and un-mute it at 6:00AM.

October 28, 2005 |

Comments Section

Feel free to comment on the post but keep it clean and on topic.

comments powered by Disqus

About Me

George Sudarkoff Climber of rocks, maker of things, husband of wife and father of kids. Manage DevOps @SurveyMonkey. Views are my own, but damn they are good views!