-
Notifications
You must be signed in to change notification settings - Fork 28
/
zoom-toggle-video.applescript
46 lines (44 loc) · 1.1 KB
/
zoom-toggle-video.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--
-- Created by: Kevin Funderburg
-- Created on: 9/15/20
--
try
if not inMeeting() then error "not in a meeting"
tell application "System Events"
tell process "zoom.us"
tell menu bar 1
tell menu bar item 3
tell menu "Meeting"
if menu item "Start Video" exists then
click menu item "Start Video"
set diag to "You're on camera"
else if menu item "Stop Video" exists then
click menu item "Stop Video"
set diag to "You're off camera"
end if
end tell
end tell
end tell
end tell
end tell
display notification (diag) with title ("Toggle zoom video")
on error errMsg number errNum
display dialog (errMsg & return & return & errNum) ¬
buttons {"Cancel", "OK"} ¬
default button ("OK") ¬
with icon caution
end try
on inMeeting()
if application "zoom.us" is not running then return false
tell application "System Events"
tell process "zoom.us"
tell menu bar 1
tell menu bar item "zoom.us"
tell menu 1
return (enabled of menu item "Join Meeting...")
end tell
end tell
end tell
end tell
end tell
end inMeeting