Created
October 13, 2020 15:27
-
-
Save ChristoferK/f055fa0f1514c3b686a6c3f0673d2f95 to your computer and use it in GitHub Desktop.
[Match Safari Tabs Against URL Substring] A fast, efficient tab filter that operates over all tabs in all Safari windows to return a reference to those where the URL contains a given phrase. #AppleScript #Safari #browser #windows #tabs #URL #filter #search
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
on SafariTabsWhoseURLsContain:(phrase as text) | |
set text item delimiters to linefeed | |
tell application id "com.apple.Safari" to if it ¬ | |
is running then tell every window to if ¬ | |
it exists then tell (it where (index of ¬ | |
tab 1 where phrase is in the URL) is in ¬ | |
index of tabs) to tell (every tab whose ¬ | |
URL contains the phrase) to if (exists) ¬ | |
then return a reference to it | |
end SafariTabsWhoseURLsContain: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment