Last active
December 24, 2022 02:11
-
-
Save sidouglas/df2bc18f9fbdb893dba69828ba54d3f1 to your computer and use it in GitHub Desktop.
Activate All Brave Windows containing substring title
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 "Brave Browser" | |
activate | |
repeat with w in (windows) | |
set j to 0 | |
repeat with t in (tabs of w) | |
set j to j + 1 | |
if title of t contains "YOUR_NAME" then | |
set (active tab index of w) to j | |
set index of w to 1 | |
tell application "System Events" to tell process "Brave Browser" | |
perform action "AXRaise" of window 1 -- `set index` doesn't always raise the window | |
end tell | |
return true | |
end if | |
end repeat | |
end repeat | |
return false | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment