Skip to content

Instantly share code, notes, and snippets.

@lorenzejay
Created September 19, 2022 15:30
Show Gist options
  • Save lorenzejay/56817730dcaeaf2c0a5a27c80281804f to your computer and use it in GitHub Desktop.
Save lorenzejay/56817730dcaeaf2c0a5a27c80281804f to your computer and use it in GitHub Desktop.
opening calendar url from input to google chrome
#!/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