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

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

Explorer ,
Jun 27, 2013 Jun 27, 2013

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!

TOPICS
Scripting
753
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 , Jun 28, 2013 Jun 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!

Translate
Advocate ,
Jun 27, 2013 Jun 27, 2013

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

_1.png

_2.png

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
Explorer ,
Jun 28, 2013 Jun 28, 2013
LATEST

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!

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