Skip to content
fabiantheblind edited this page Jan 6, 2016 · 1 revision

Create a file and write to it. If the folder does not exists create it. (This is for Mac. Contributions for Windows are welcome. Actually the only thing to change is the path to the desktop. Does windows have a shortcut like the ~ on unix systems?).

if(Folder('~/Desktop/testing').exists !== true){
    Folder('~/Desktop/testing').create();
    }
var f = new File ('~/Desktop/testing/file.txt');
f.open('w');
f.write('test');
f.close();

Clone this wiki locally