Created
February 18, 2013 19:43
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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