Created
January 19, 2022 00:24
-
-
Save eparadis/67ee56ef1ee3f14aae70f4e29dd84f90 to your computer and use it in GitHub Desktop.
Applescript to determine the state of a Zoom meeting `smitmartijn/stream-deck-zoom-plugin`
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
# https://github.com/smitmartijn/streamdeck-zoom-plugin/blob/33892febdc188b2124b2a32c55b84ba3d2b5c949/Sources/MacOS.cpp#L66 | |
# run with `osascript` | |
set zoomStatus to "closed" | |
set muteStatus to "disabled" | |
set videoStatus to "disabled" | |
set shareStatus to "disabled" | |
set recordStatus to "disabled" | |
tell application "System Events" | |
if exists (window 1 of process "zoom.us") then | |
set zoomStatus to "open" | |
tell application process "zoom.us" | |
if exists (menu bar item "Meeting" of menu bar 1) then | |
set zoomStatus to "call" | |
if exists (menu item "Mute audio" of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
set muteStatus to "unmuted" | |
else | |
set muteStatus to "muted" | |
end if | |
if exists (menu item "Start Video" of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
set videoStatus to "stopped" | |
else | |
set videoStatus to "started" | |
end if | |
if exists (menu item "Start Share" of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
set shareStatus to "stopped" | |
else | |
set shareStatus to "started" | |
end if | |
if exists (menu item "Record to the Cloud" of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
set recordStatus to "stopped" | |
else if exists (menu item "Record" of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
set recordStatus to "stopped" | |
else | |
set recordStatus to "started" | |
end if | |
end if | |
end tell | |
end if | |
end tell | |
do shell script "echo zoomMute:" & (muteStatus as text) & ",zoomVideo:" & (videoStatus as text) & ",zoomStatus:" & (zoomStatus as text) & ",zoomShare:" & (shareStatus as text) & ",zoomRecord:" & (recordStatus as text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment