Terminal Mute Command

Discussion in 'Mac Apps and Mac App Store' started by Switchfoot, Oct 8, 2004.

  1. Switchfoot macrumors member

    Oct 8, 2004
    Does anyone know of a way to mute an app from the Terminal command line? What I want to do is be able to type "ps" or "top" or something and be able to say something like "mute pid#". Is something like this possible?
  2. musicpyrite macrumors 68000


    Jan 6, 2004
    Cape Cod
    I did a quick Google search, and didn't find anything that worked. But if you'd like to know, you can use the "say'' command to make your computer talk to you. That and xDoctor are all I need for a whole night of fun. :D
  3. Doctor Q Administrator

    Doctor Q

    Staff Member

    Sep 19, 2002
    Los Angeles
    For a specific application that has an AppleScript volume command, you can use something like this:
    tell application "iTunes"
            set the sound volume to 40
    end tell
    Otherwise, I think you'd have to apply a system-wide mute operation, which can be done with this Terminal command:
    /usr/bin/osascript -e 'set volume 0'
  4. jherrling macrumors newbie

    Oct 8, 2004
    This will only work if you have 10.3.5 I belive. It's basically just an apple script and if you use Doctor Q's method this should work in the command line or you can just make a script out of it. If you don't have 10.3.5 go with one of the other suggestions. A note about this is that it works like the mute button on the keyboard or the check box in system prefs, so if you unmute it, the volume will automatically go back to where it was.

    set volume output muted 1

    and to undo this it would be

    set volume output muted 0

    hope this helps

Share This Page