Copy link to clipboard
Copied
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();
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you very much
Find more inspiration, events, and resources on the new Adobe Community
Explore Now