Skip to content

Instantly share code, notes, and snippets.

@jbranchaud
Created November 6, 2022 01:51
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 jbranchaud/879263ef5e95b7b740e3dc29a1d763b9 to your computer and use it in GitHub Desktop.
Save jbranchaud/879263ef5e95b7b740e3dc29a1d763b9 to your computer and use it in GitHub Desktop.
ScriptKit script to close the active Chrome tab if it is open to Taco Bell
let jxa = await npm("@jxa/run")
let result = await jxa.run(() => {
let app = Application("com.google.Chrome")
let windows = app.windows()
let frontWindow = windows[0]
let tab = frontWindow.activeTab()
let closedTabData = {
id: tab.id(),
url: tab.url(),
title: tab.title(),
}
if(tab.url() === 'https://www.tacobell.com/') {
tab.close()
}
return closedTabData
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment