Created
November 6, 2022 01:51
-
-
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
This file contains hidden or 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
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