Created
January 12, 2017 03:30
-
-
Save alexanderchan/0ec4c17dbeb9a957ca61e500ed083075 to your computer and use it in GitHub Desktop.
write a file and open the contents in atom
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
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