Created
May 10, 2018 07:03
-
-
Save komeiji-satori/ea49deaf272e6ae6eb1a80678d32f09e to your computer and use it in GitHub Desktop.
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
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