Created
April 27, 2021 12:17
-
-
Save Slruh/aebc6202e9caa272e0b3e85d51f145a1 to your computer and use it in GitHub Desktop.
AppleScript to Focus Meet
This file contains 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
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