Created
March 26, 2020 13:00
-
-
Save rumpl/c57aedfc9e88fd4605890e9c5e62d1ea to your computer and use it in GitHub Desktop.
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
function toggleZoomMute() | |
local zoom = hs.appfinder.appFromName("zoom.us") | |
if (zoom == nil) then | |
return | |
end | |
local unmute = {"Meeting", "Unmute Audio"} | |
local mute = {"Meeting", "Mute Audio"} | |
if (zoom:findMenuItem(mute)) then | |
zoom:selectMenuItem(mute) | |
hs.alert.show("Zoom Muted") | |
elseif (zoom:findMenuItem(unmute)) then | |
zoom:selectMenuItem(unmute) | |
hs.alert.show("Zoom Unmuted") | |
end | |
end | |
function toggleZoomVideo() | |
local zoom = hs.appfinder.appFromName("zoom.us") | |
if (zoom == nil) then | |
return | |
end | |
local stop = {"Meeting", "Stop Video"} | |
local start = {"Meeting", "Start Video"} | |
if (zoom:findMenuItem(start)) then | |
zoom:selectMenuItem(start) | |
hs.alert.show("Video started") | |
elseif (zoom:findMenuItem(stop)) then | |
zoom:selectMenuItem(stop) | |
hs.alert.show("Video stopped") | |
end | |
end | |
hs.hotkey.bind({"cmd", "shift"}, "A", function() | |
toggleZoomMute() | |
end) | |
hs.hotkey.bind({"cmd", "shift"}, "V", function() | |
toggleZoomVideo() | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment