Created
September 19, 2022 15:30
-
-
Save lorenzejay/56817730dcaeaf2c0a5a27c80281804f to your computer and use it in GitHub Desktop.
opening calendar url from input to google chrome
This file contains 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
#!/usr/bin/env osascript -l JavaScript | |
const chrome = Application("Google Chrome"); | |
const window = chrome.Window().make(); | |
function run(input) { | |
const url = input[0][0]; | |
let tab = chrome.Tab({url}); | |
if(url.startsWith("https")){ | |
return chrome.windows[0].tabs[0].url = url; | |
}{ | |
return "url needs to start with https.." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment