Skip to content

Instantly share code, notes, and snippets.

@komeiji-satori
Created May 10, 2018 07:03
Show Gist options
  • Save komeiji-satori/ea49deaf272e6ae6eb1a80678d32f09e to your computer and use it in GitHub Desktop.
Save komeiji-satori/ea49deaf272e6ae6eb1a80678d32f09e to your computer and use it in GitHub Desktop.
ObjC.import('Foundation');
var app = Application.currentApplication()
app.includeStandardAdditions = true
var args = $.NSProcessInfo.processInfo.arguments;
var argv = []
var argc = args.count // -[NSArray count]
for (var i = 0; i < argc; i++) {
argv.push( ObjC.unwrap( args.objectAtIndex(i) ) ) // -[NSArray objectAtIndex:]
}
delete args;
function notify(title="", withTitle="", subtitle="", soundName="Hero"){
app.displayNotification(title, {
withTitle: withTitle,
subtitle: subtitle,
soundName: soundName
});
}
notify(argv[2],argv[3],argv[4],argv[5]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment