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

Writing text file from ae (Meet writes one line)

Participant ,
Jul 12, 2016 Jul 12, 2016

If I run the code from the extended toolkit, it works well,

But if I run the code through the after effect does not work well (writes everything on one line instead of two lines)

What should I do in order that through the after effects it will work properly?

thenks

var a=3;

var c=[10,16,7];

var myfile =new File("~/desktop/test1.txt")

myfile.open("w");

myfile.write(a+"\n"+c);

myfile.close();

win.close();

TOPICS
Scripting
483
Translate
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

correct answers 1 Correct answer

Explorer , Jul 12, 2016 Jul 12, 2016

Your problem is not that it's write it to one line, but add 3 to 10 so the output is:

13,6,7

You can make it work by changing this line:

myfile.write(a+"\n"+c);

to:

myfile.write(a+"\n"+c.join(","));

I don't know why AE works like that, but the solution will work.

Personally I don't like to concat diffrent types, and I write to files only strings.

Translate
Explorer ,
Jul 12, 2016 Jul 12, 2016

Your problem is not that it's write it to one line, but add 3 to 10 so the output is:

13,6,7

You can make it work by changing this line:

myfile.write(a+"\n"+c);

to:

myfile.write(a+"\n"+c.join(","));

I don't know why AE works like that, but the solution will work.

Personally I don't like to concat diffrent types, and I write to files only strings.

Translate
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
Participant ,
Jul 12, 2016 Jul 12, 2016
LATEST

Thank you very much

Translate
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