Last active
May 11, 2023 09:17
-
-
Save ChristoferK/b562a0baf0898bf4229f6af37faacf24 to your computer and use it in GitHub Desktop.
[Close Every Other Tab In All Browser Windows] A pair of scripts that close every other tab in all windows of a Chromium-based browser or Safari, leaving the currently active tab open by itself. #AppleScript #browser #Chromium #Chrome #Brave #Safari #close #tabs
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
--OR: tell app id "com.google.Chrome" | |
tell application id "com.brave.browser" to if it is ¬ | |
running then tell every window to if (exists) ¬ | |
then close (the tabs whose id ≠ my window 1's ¬ | |
active tab's id) |
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 id "com.apple.Safari" to if running ¬ | |
then tell windows to if (exists) then close ¬ | |
(tabs where it ≠ current tab of my window 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment