Skip to main content
yon1313
Known Participant
July 12, 2016
Answered

Writing text file from ae (Meet writes one line)

  • July 12, 2016
  • 1 reply
  • 494 views

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();

This topic has been closed for replies.
Correct answer ttzviiol

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.

1 reply

ttzviiolCorrect answer
Inspiring
July 13, 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.

yon1313
yon1313Author
Known Participant
July 13, 2016

Thank you very much