Terminal Mute Command

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

  1. Switchfoot macrumors member

    Joined:
    Oct 8, 2004
    #1
    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

    musicpyrite

    Joined:
    Jan 6, 2004
    Location:
    Cape Cod
    #2
    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

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #3
    For a specific application that has an AppleScript volume command, you can use something like this:
    Code:
    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:
    Code:
    /usr/bin/osascript -e 'set volume 0'
     
  4. jherrling macrumors newbie

    Joined:
    Oct 8, 2004
    #4
    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