Skip to content

Instantly share code, notes, and snippets.

@rentzsch
Created June 26, 2011 20:56
Show Gist options
  • Save rentzsch/1047967 to your computer and use it in GitHub Desktop.
Save rentzsch/1047967 to your computer and use it in GitHub Desktop.
Close a Chrome Tab using AppleScript
tell application "Google Chrome"
set windowList to every tab of every window whose URL starts with "https://mail.google.com"
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
@null-unknown
Copy link

I do like the idea, but too bad that it fails in Safari when you have 10 tabs open that contains your condition. Chrome works flawless!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment