2

I can't find the default keybinding to mute the sound in OS X El Capitan. I just want the whole OS to be muted.

Running osascript -e "set Volume X" from the terminal is not what I want to do. Because I need to store the current volume somewhere and launch a script on a specific key. It just seems like wrong approach.

F10 and any combinations of it with Command or Control did not help.

  • Why not just F10? – Arc676 Dec 4 '15 at 10:58
  • @Arc676 as I've mentioned in my question. F10 and combinations of it with command or control didnt help. – lukas.pukenis Dec 4 '15 at 11:08
  • 3
    Yes but F10 by itself (or depending on preferences Fn+F10) is by default the mute button. Are you having keyboard issues? – Arc676 Dec 4 '15 at 11:09
  • 1
    What is your Mac model (MacBook, MacBook Pro, MacBook Air, iMac etc.) and what model is your keyboard (you don't have to answer this if you use the keyboard that is attached to a MacBook Original/Pro/Air)? I require this for clarification. – Brick Dec 4 '15 at 11:27
  • 3
    You should include that kind of information directly in your post to avoid this kind of confusion. – Arc676 Dec 4 '15 at 11:31
5

Try toggling the F-key functionality in System Prefs > Keyboard > Keyboard

If your generic keyboard has no Mac-compliant Fn key, it may be your only solution. The hardware keys don't transmit in the same way as 'regular' keys.

enter image description here

This script works for Yosemite, but not El Capitan…

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

An additional possibility could be to switch to another Sound output, one that is currently silenced, like, for example, Digital Out.

From Using Apple Script to Manage Sound Output Selection

You could save this as a Service in Automator, then call it with a hot-key

(*
Applescript to toggle between two sound outputs by Line number, ¬
as they appear in the Sound Control Panel. Based on code by ¬
Arthur Hammer https://apple.stackexchange.com/a/209434/85275
*)

set outputA to 3 --change this to the actual 'line number' of your first desired output
set outputB to 4 --change this to the actual 'line number' of your second desired output
--the rest of the script will use these vales as a switch

tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.sound"
end tell


tell application "System Events"
    tell application process "System Preferences"
        repeat until exists tab group 1 of window "Sound"
        end repeat
        tell tab group 1 of window "Sound"
            click radio button "Output"
            if (selected of row outputA of table 1 of scroll area 1) then
                set selected of row outputB of table 1 of scroll area 1 to true
            else
                set selected of row outputA of table 1 of scroll area 1 to true
            end if
        end tell
    end tell
end tell
--tell application "System Preferences" to quit
--remove the comment '--' tag above to make the control panel quit afterwards, leave for testing.
  • El Capitan doesn't have this checkbox. I've already looked as per apple.stackexchange.com/questions/143609/… this question – lukas.pukenis Dec 4 '15 at 11:49
  • 1
    I just took that picture on El Capitan. Maybe it doesn't have it if your keyboard has no recognisable Fn key? I also added a script which works up to Mavericks, but not on el cap. – Tetsujin Dec 4 '15 at 11:58
  • Up to Yosemite, sorry. Just tested on both OSes. – Tetsujin Dec 4 '15 at 12:05
  • An additional solution based on something I found whilst researching this one - added to answer. – Tetsujin Dec 4 '15 at 12:47
3

It's possible with Karabiner ( a keyboard customizer )

If you search for mute in karabiner, you get this:

You can also try to search for: "Volume control"

enter image description here

The take away from this is that there are many presets for mute to choose from. They are meant for different situations an for different types of keyboards.


Might not be necessary in your case, but just so you know. You can also make custom settings with the private.xml file. Here's more documentation on that.


I personally use this setting with my keyboard (Logitech G710+)

enter image description here

  • I know G710+ has dedicated volume wheel and mute button, plus you can set the "G" keys to control those via the Logitech Gaming Software, but I sometimes try to use F10-F12 to control these things by accident, which is why I used karabiner to place them to the familiar keys. – Joonas Dec 4 '15 at 13:36
0

set volume with output muted

will mute without changing volume, so unmute returns you back to the prior volume.

Search for "volume" in StandardAdditions

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .