Skip to content

Instantly share code, notes, and snippets.

@alexanderchan
Created January 12, 2017 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderchan/0ec4c17dbeb9a957ca61e500ed083075 to your computer and use it in GitHub Desktop.
Save alexanderchan/0ec4c17dbeb9a957ca61e500ed083075 to your computer and use it in GitHub Desktop.
write a file and open the contents in atom
function run(input, parameters) {
ObjC.import('Cocoa');
var str = $.NSString.alloc.initWithUTF8String(input);
var jsonPath = Path('/tmp/test.json');
str.writeToFileAtomically(jsonPath.toString(), true);
var atom = Application('Atom')
atom.open(jsonPath)
return input;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment