Skip to content

Instantly share code, notes, and snippets.

@ljlin
Created March 17, 2015 14:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljlin/2146b2ed580db6a05ed5 to your computer and use it in GitHub Desktop.
Save ljlin/2146b2ed580db6a05ed5 to your computer and use it in GitHub Desktop.
JavaScript for OS X Automation, NSTask, jar
ObjC.import("Cocoa");
var MarsPath = "/Applications/Mars4_5.jar"
var arg = $.NSArray.arrayWithObjects(MarsPath)
var task = $.NSTask.alloc.init
task.setLaunchPath("/usr/bin/open")
task.setArguments(arg)
task.launch
@cvcore
Copy link

cvcore commented Apr 7, 2015

thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment