Skip to content

Instantly share code, notes, and snippets.

@kitallis
Created October 9, 2015 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitallis/884c39a88cae697249ad to your computer and use it in GitHub Desktop.
Save kitallis/884c39a88cae697249ad to your computer and use it in GitHub Desktop.
on run {input, parameters}
set inputVolume to input volume of (get volume settings)
set curVolume to (get volume settings)
if (inputVolume = 0 and (output muted of curVolume is false)) then
set inputVolume to 100
set volume with output muted
set displayNotification to "Microphone on, speakers off"
else if (inputVolume > 0 and (output muted of curVolume is true)) then
set inputVolume to 0
set volume without output muted
set displayNotification to "Microphone off, speakers on"
else if (inputVolume = 0 and (output muted of curVolume is true)) then
set inputVolume to 100
set volume without output muted
set displayNotification to "Microphone on, speakers on"
else if (inputVolume > 0 and (output muted of curVolume is false)) then
set inputVolume to 0
set volume with output muted
set displayNotification to "Microphone off, speakers off"
end if
set volume input volume inputVolume
display notification displayNotification
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment