Skip to content

Instantly share code, notes, and snippets.

@Slruh
Created April 27, 2021 12:17
Show Gist options
  • Save Slruh/aebc6202e9caa272e0b3e85d51f145a1 to your computer and use it in GitHub Desktop.
Save Slruh/aebc6202e9caa272e0b3e85d51f145a1 to your computer and use it in GitHub Desktop.
AppleScript to Focus Meet
tell application "Google Chrome"
repeat with w in (windows)
set j to 0
repeat with t in (tabs of w)
set j to j + 1
set ti to title of t
if ti contains "Meet - " then
tell application "Google Chrome"
activate
end tell
set (active tab index of w) to j
set index of w to 1
tell application "System Events" to tell process "Google Chrome"
perform action "AXRaise" of window 1 -- `set index` doesn't always raise the window
end tell
return
end if
end repeat
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment