Skip to content

Instantly share code, notes, and snippets.

@edenwaith
Created February 25, 2020 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edenwaith/6df63733b330d7fe39bcf4cea83ddf78 to your computer and use it in GitHub Desktop.
Save edenwaith/6df63733b330d7fe39bcf4cea83ddf78 to your computer and use it in GitHub Desktop.
AppleScript to close all Atlassian-related tabs in Google Chrome
-- File: CloseAcmeTabs.scpt
-- Description: Iterate through all open Google Chrome windows and close any Atlassian-related tabs.
-- Author: Chad Armstrong
-- Date: 25 February 2020
tell application "Google Chrome"
-- Iterate through every Chrome tab and find any Atlassian pages (JIRA, Confluence)
set windowList to every tab of every window whose (URL starts with "https://wiki.acme.com/") or (URL starts with "https://jira.acme.com/")
set tabsToClose to 0
repeat with tabList in windowList
set tabList to tabList as any
repeat with currentTab in tabList
set currentTab to currentTab as any
delete currentTab
set tabsToClose to tabsToClose + 1
end repeat
end repeat
log "There were " & tabsToClose & " Acme tabs closed."
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment