Skip to content

Instantly share code, notes, and snippets.

@houshuang
Created December 3, 2020 17:33
Show Gist options
  • Save houshuang/e8f96a803987b4d4107db365ddf9f617 to your computer and use it in GitHub Desktop.
Save houshuang/e8f96a803987b4d4107db365ddf9f617 to your computer and use it in GitHub Desktop.
set found to 0
tell application "Google Chrome"
repeat with w in windows
set i to 1
repeat with t in tabs of w
if URL of t starts with "https://roamresearch.com/#/app/stian" then
activate
set active tab index of w to i
set index of w to 1
set found to 1
delay 0.01
do shell script "open -a Google\\ Chrome"
return
end if
set i to i + 1
end repeat
end repeat
log found
if found ≠ 1 then
activate
open location "https://roamresearch.com/#/app/stian"
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment