Skip to content

Instantly share code, notes, and snippets.

@cristoslc
Last active March 23, 2021 11:58
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 cristoslc/9d30eaabfc06e15587964e16c5aca70f to your computer and use it in GitHub Desktop.
Save cristoslc/9d30eaabfc06e15587964e16c5aca70f to your computer and use it in GitHub Desktop.
try
tell application "zoom.us"
activate
end tell
tell application "System Events"
# Get the frontmost app's *process* object.
set frontAppProcess to first application process whose frontmost is true
end tell
delay 0.5
# Tell the *process* to count its windows and return its front window's name.
tell frontAppProcess
if (count of windows) > 0 then
get every window
repeat with W in the result
select W
set window_name to name of W
if window_name is "Zoom Meeting" then
tell application "System Events"
keystroke "w" using (command down)
delay 0.5
key code 36
end tell
end if
end repeat
end if
end tell
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment