Skip to content

Instantly share code, notes, and snippets.

@rinogo
Created February 3, 2023 16:15
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 rinogo/e1dd217186a068ca4ea44743cdfa8a9a to your computer and use it in GitHub Desktop.
Save rinogo/e1dd217186a068ca4ea44743cdfa8a9a to your computer and use it in GitHub Desktop.
Applescripts to use with Swiftbar for showing status of Zoom camera and microphone in the macOS menu bar. Paired with shortcuts in the Zoom app, this is an easy way to toggle Zoom's audio and video on and off.
#!/usr/bin/osascript
# <bitbar.title>zoomMuteState</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>nickjvturner</bitbar.author>
# <bitbar.author.github>nickjvturner</bitbar.author.github>
# <bitbar.desc>Zoom Mute State</bitbar.desc>
# <bitbar.image>http://www.hosted-somewhere/pluginimage</bitbar.image>
# <bitbar.dependencies>Applescript</bitbar.dependencies>
# <bitbar.abouturl>http://url-to-about.com/</bitbar.abouturl>
# <swiftbar.hideAbout>true</swiftbar.hideAbout>
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal>
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated>
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin>
# <swiftbar.hideSwiftBar>false</swiftbar.hideSwiftBar>
property btnTitle : "Mute audio"
if application "zoom.us" is running then
tell application "System Events"
tell application process "zoom.us"
if exists (menu bar item "Meeting" of menu bar 1) then
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
#set returnValue to "LIVE MIC"
set returnValue to ":mic.fill: | sfcolor=red"
else
#set returnValue to "MUTED"
set returnValue to ":mic.slash.fill:"
end if
else
set returnValue to ""
end if
end tell
end tell
else
set returnValue to ""
end if
return returnValue & "| size=18
---
zoomMuteState"
#!/usr/bin/osascript
# <bitbar.title>zoomShareScreenState</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>nickjvturner</bitbar.author>
# <bitbar.author.github>nickjvturner</bitbar.author.github>
# <bitbar.desc>Zoom Share Screen State</bitbar.desc>
# <bitbar.image>http://www.hosted-somewhere/pluginimage</bitbar.image>
# <bitbar.dependencies>Applescript</bitbar.dependencies>
# <bitbar.abouturl>http://url-to-about.com/</bitbar.abouturl>
# <swiftbar.hideAbout>true</swiftbar.hideAbout>
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal>
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated>
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin>
# <swiftbar.hideSwiftBar>false</swiftbar.hideSwiftBar>
property btnTitle : "Start Share"
if application "zoom.us" is running then
tell application "System Events"
tell application process "zoom.us"
if exists (menu bar item "Meeting" of menu bar 1) then
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
set returnValue to ""
else
set returnValue to "SCREEN SHARE ACTIVE"
end if
else
set returnValue to ""
end if
end tell
end tell
else
set returnValue to ""
end if
return returnValue & "| size=18
---
zoomScreenShareState"
#!/usr/bin/osascript
# <bitbar.title>zoomVideoState</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>nickjvturner</bitbar.author>
# <bitbar.author.github>nickjvturner</bitbar.author.github>
# <bitbar.desc>Zoom Video State</bitbar.desc>
# <bitbar.image>http://www.hosted-somewhere/pluginimage</bitbar.image>
# <bitbar.dependencies>Applescript</bitbar.dependencies>
# <bitbar.abouturl>http://url-to-about.com/</bitbar.abouturl>
# <swiftbar.hideAbout>true</swiftbar.hideAbout>
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal>
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated>
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin>
# <swiftbar.hideSwiftBar>false</swiftbar.hideSwiftBar>
property btnTitle : "Stop Video"
if application "zoom.us" is running then
tell application "System Events"
tell application process "zoom.us"
if exists (menu bar item "Meeting" of menu bar 1) then
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
#set returnValue to "VIDEO ACTIVE"
set returnValue to ":eye.fill: | sfcolor=red"
else
#set returnValue to "NO VIDEO"
set returnValue to ":eye.slash:"
end if
else
set returnValue to ""
end if
end tell
end tell
else
set returnValue to ""
end if
return returnValue & "| size=18
---
zoomVideoState"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment