Skip to main content
Inspiring
June 27, 2013
Answered

file.write(string) won't work in After Effects CC?

  • June 27, 2013
  • 1 reply
  • 753 views

Hi!

This script working perfectly in AE CS6:

var newContent = '<Project author="Donald">';

newContent += '\n<Start>' + "starttime" + '</Start>';

newContent += '\n</Project>';

try {

     var data = new XML ( newContent );

     var string = data.toXMLString();

     filePath = "E:/test.xml";

     var file = new File (filePath);

     file.open("w");

     file.write(string);

     file.close();

     alert("DONE for " + String (file));

     }

catch (error) { alert("Error!"); }

But stop working in After Effects CC on step:  file.write(string);

Can you show me the way how to make it work please?

Thank you in advance!

This topic has been closed for replies.
Correct answer zanozza

Oh, sorry, my friends, this is my fault, I've forgot to tick "Edit -> Parameters -> General -> Allow Scripts to Write Files and Access Network" ON after installation.

Cheers!

1 reply

Legend
June 27, 2013

Worked fine for me on AE CC. It followed through to the alert and also created the XML.

zanozzaAuthorCorrect answer
Inspiring
June 28, 2013

Oh, sorry, my friends, this is my fault, I've forgot to tick "Edit -> Parameters -> General -> Allow Scripts to Write Files and Access Network" ON after installation.

Cheers!