Skip to content

Instantly share code, notes, and snippets.

@chengjianhua
Created February 18, 2021 17:35
Show Gist options
  • Save chengjianhua/a148dc2d8b7f179b62e48d20204ddf40 to your computer and use it in GitHub Desktop.
Save chengjianhua/a148dc2d8b7f179b62e48d20204ddf40 to your computer and use it in GitHub Desktop.
Execute shell in javascript for automation (osascript) #osx #alfred
ObjC.import("stdlib");
function run(argv) {
const app = Application.currentApplication()
app.includeStandardAdditions = true
app.doShellScript(`open https://www.baidu.com`)
var query = argv[0];
return query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment