Copy link to clipboard
Copied
I'm on a Mac, trying to read a large JSON file. The file is over 65k characters without any returns/line feeds.
When ExtendScript attempts to read the file, it chokes. If I insert a bunch of returns in the file to break it into shorter lines, it reads fine.
myDataFile.encoding = "UTF-8";
myDataFile.open("r");
var myDataText = myDataFile.read();
myDataFile.close();
I assume this is a limitation of ExtendScript I'm going to have to live with. Can anyone think of any workarounds? I've tried it without declaring encoding also, and there was no change.
Am I going to have to do a clunky workaround like use doScript to run an AppleScript to open the file and insert returns and then pass the file to ExtendScript? Thoughts?
Have something to add?