I attend several recurring Zoom meetings every day and would like to control Zoom’s audio output. I need a AppleScript or JavaScript to toggle On / Off Zoom audio without changing it at MacOS [System Level] only in Zoom App.
I use Zoom Output "Select a Speaker" according to the following options:
Audio-On = Build-In Output (Internal Speaker) /
Audio-Off = NDI Audio (not in operation)
To accomplish this I use the following steps:
Zoom has a [Mute-Mic] but no [Mute-Spkr] button. It would be nice to have this handy, when you need to answer a phone call.
For example: I wrote using the Automator my click action on the current webpage.
Here is generated Automator code:
on run {input, parameters}
-- Mouse Clicked
delay 7.956482
set timeoutSeconds to 2.000000
set uiScript to "click group 1 of list 2 of group 8 of UI Element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window \"javascript - Toggle Audio-Output On/Off within Zoom Meetings (MacOS) - Stack Overflow\" of application process \"Safari\""
my doWithTimeout( uiScript, timeoutSeconds )
return input
end run
on doWithTimeout(uiScript, timeoutSeconds)
set endDate to (current date) + timeoutSeconds
repeat
try
run script "tell application \"System Events\"
" & uiScript & "
end tell"
exit repeat
on error errorMessage
if ((current date) > endDate) then
error "Can not " & uiScript
end if
end try
end repeat
end doWithTimeout
I take from the script above only this useful content. As you can see I grab only the correct UI action (the value of uiScript variable) :
tell application "System Events" to tell application process "Safari"
set frontmost to true -- required
click group 1 of list 2 of group 8 of UI element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window "javascript - Toggle Audio-Output On/Off within Zoom Meetings (MacOS) - Stack Overflow"
end tell