Skip to content

Instantly share code, notes, and snippets.

@bittersweet
Created March 30, 2012 08:23
Show Gist options
  • Save bittersweet/2249539 to your computer and use it in GitHub Desktop.
Save bittersweet/2249539 to your computer and use it in GitHub Desktop.
Mute OSX volume with MacRuby and AppleScript
framework "ScriptingBridge"
def volume(value)
volume = "set volume output volume #{value}"
applescript = NSAppleScript.alloc.initWithSource(volume)
result = applescript.executeAndReturnError(nil)
end
volume(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment