Quicksilver’s iTunes plugin comes with several excellent scripts, one of them is to mute iTunes.

The only problem is, that you can still hear all the system sounds. Pretty annoying if you are in a meeting or sitting in a class.

My workaround was to write an Apple Script to control the system volume:

set curVol to (get (output volume of (get volume settings)))
if curVol > 0 then
  set volume output volume 0
else
  set volume output volume 50
end if

This script will mute the system volume, or set it back to 50% if it’s already muted (the value for “set volume” is a percentage value from 0 to 100).

That’s it, I created a keyboard trigger to execute this script (I used Shift-Ctrl-Command + M) and I can mute my system without having to use the mouse or trackpad.

4 Responses to “Mute system volume with Apple Script and Quicksilver”

  1. #1 metaly says:

    Thanks for this quick script. I just got a new keyboard and the default function keys were driving me crazy. I’m surprised that there wasn’t a convenient mute/unmute option in Apple’s own Keyboard Shortcuts system preferences, or at least one that’s easy to find.

  2. #2 sampler says:

    The current script raises the volume to 93 no matter what it was before muting. Here’s a version that leaves the volume where it was:

    set _muted to (get (output muted of (get volume settings)))
    if _muted is false then
    set volume with output muted
    else
    set volume without output muted
    end if

  3. #3 sampler says:

    Here’s a version that leaves the volume where it was before it was muted.

    (* Mute/Unute
    *)
    set _muted to (get (output muted of (get volume settings)))
    if _muted is false then
    set volume with output muted
    else
    set volume without output muted
    end if

  4. #4 Developing an On-the-Phone AppleScript | GFMorris.org says:

    [...] first step was to use Leaf Raker’s suggestion for how to mute the system volume with AppleScript. The approach there works fine; the only issue is going to be that the system volume returns to 50 [...]