Export a Json object to a text File

前端 未结 3 1544
逝去的感伤
逝去的感伤 2021-02-02 18:09

I\'m trying to write a Json object (JsonExport) and I\'d like to write its content into a text file.

I\'m using max4live to export data from Audio DAW to Json in order t

3条回答
  •  被撕碎了的回忆
    2021-02-02 18:24

    Finally I got it! It worked by changing few parameters like this:

       var txtFile = "/tmp/test.txt";
       var file = new File(txtFile,"write");
       var str = JSON.stringify(JsonExport);
    
       log("opening file...");
       file.open(); 
       log("writing file..");
       file.writeline(str);
       file.close();
    

    Path to my directories not allowed, so i had to save it on /tmp directory. Thanks to all!

提交回复
热议问题