PDA

View Full Version : Terminal Mute Command




Switchfoot
Oct 8, 2004, 06:28 PM
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?



musicpyrite
Oct 8, 2004, 06:46 PM
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

Doctor Q
Oct 8, 2004, 06:57 PM
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'

jherrling
Oct 8, 2004, 08:51 PM
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