Skip to content

Instantly share code, notes, and snippets.

@rgbink
Last active October 26, 2022 07:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgbink/046e52569bc29a630387c322b75d2711 to your computer and use it in GitHub Desktop.
Save rgbink/046e52569bc29a630387c322b75d2711 to your computer and use it in GitHub Desktop.
Applescript to Close particular tab(s) in Google Chrome
tell application "Google Chrome"
-- edit the following url to be as specific or generic as you wish
-- in my functioning script I've added the particular spreadsheet that I wish to close
set windowList to every tab of every window whose URL starts with "https://docs.google.com/spreadsheets/"
repeat with tabList in windowList
set tabList to tabList as any
repeat with tabItr in tabList
set tabItr to tabItr as any
delete tabItr
end repeat
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment