Skip to content

Instantly share code, notes, and snippets.

@ljlin
Created March 17, 2015 14:38
Show Gist options
  • Select an option

  • Save ljlin/2146b2ed580db6a05ed5 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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