ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Can't write to file (after effects scripting)

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Arno Deceuninck
Can't write to file (after effects scripting)
on Jun 18, 2017 at 4:01:21 pm

I have this code:
var exportDurationFile = new File;
exportDurationFile = exportDurationFile.saveDlg ("Choose your duration export location", "Text File:*.txt");

exportDurationFile.open("w");
$.writeln("opened for writing");

exportDurationFile.encoding = "UTF-8";
$.writeln("Encoding set to UTF-8");

exportDurationFile.write("test");
$.writeln("test written to it");

exportDurationFile.close();
$.writeln("file closed");

$.writeln("export succesfully");


But it doesn't write anything to the file, this is the console output:
Select output file
opened for writing
Encoding set to UTF-8


Does anyone know what I'm doing wrong?


Return to posts index

Walter Soyka
Re: Can't write to file (after effects scripting)
on Jun 19, 2017 at 2:24:08 pm

Your code is fine. You have to make sure you've enabled "Allow Scripts to Write to Files and Access Network" in Ae's general preferences.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Arno Deceuninck
Re: Can't write to file (after effects scripting)
on Jun 19, 2017 at 6:06:47 pm

Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]