Skip to content

Instantly share code, notes, and snippets.

@alissonperez
Forked from mayoff/gist:1138816
Last active October 22, 2022 15:23
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 alissonperez/10a17496d63caca36fcdb1c2d8a636ac to your computer and use it in GitHub Desktop.
Save alissonperez/10a17496d63caca36fcdb1c2d8a636ac to your computer and use it in GitHub Desktop.
AppleScript to make Google Chrome Canary open/reload a URL
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *)
tell application "Google Chrome Canary"
activate
set i to 0
repeat with w in (windows) -- loop over each window
set j to 1 -- tabs are not zeroeth
repeat with t in (tabs of w) -- loop over each tab
if title of t starts with "Meet:" then
set (active tab index of w) to j -- set Meet tab to active
set index of w to 1 -- set window with Meet tab to active
delay 0.5
do shell script "open -a Google\\ Chrome\\ Canary" -- these two lines are hackery to actually activate the window
tell application "System Events" to tell process "Google Chrome Canary" to keystroke "d" using command down -- issue keyboard command
return
end if
set j to j + 1
end repeat
set i to i + 1
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment