• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Reading a very long line of text chokes ExtendScript

Contributor ,
Apr 26, 2019 Apr 26, 2019

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?

TOPICS
Scripting

Views

174

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation