Skip to content

Instantly share code, notes, and snippets.

@dansherman
Created February 18, 2013 19:43
Show Gist options
  • Select an option

  • Save dansherman/4980057 to your computer and use it in GitHub Desktop.

Select an option

Save dansherman/4980057 to your computer and use it in GitHub Desktop.
Toggle mute via applescript. Needed for my hackintosh, since the motherboards audio controller doesn't support system mute.
set filepath to "~/.volume"
set currentVolume to output volume of (get volume settings)
if not currentVolume = 0 then
set volume output volume 0
do shell script "echo " & currentVolume & " > ~/.volume"
else
set newVolume to do shell script "tail -n 1 ~/.volume"
set volume output volume newVolume
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment