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

read XML file on network drive via script

Community Beginner ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

Hi guys,

I am trying to write a script which starts by reading an XML file, no problem at all in a quick and dirty test:

var XMLfile = new File("D:\Shot01.xml");

XMLfile.open('r');

var str = "";

while(!XMLfile.eof)

str += XMLfile.readln();

XMLfile.close();

alert(str);

This works perfectly well, but when I try to read the same file from a network drive:

var XMLfile = new File("T:\__SharedAssets\Assets_AE\Scripts\ShotManager\Shot01.xml");

I don't get anything at all. After Effects has been set to allow network access of course ( Edit -> Parameters -> General -> Allow Scripts to Write Files and Access Network ).

Obviously we don't keep any project files on local drives so I'm stuck at the moment. Do you have any idea what might be going on?

Thanks in advance!

TOPICS
Scripting

Views

996

Translate

Translate

Report

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

Advocate , Sep 01, 2017 Sep 01, 2017

What would this return?

var XMLfile = new File("T:\__SharedAssets\Assets_AE\Scripts\ShotManager\Shot01.xml");

alert(XMLfile.exists);

If it returns false, witch it probably will, try escape slashes in the path: "\" to "\\":

var XMLfile = new File("T:\\__SharedAssets\\Assets_AE\\Scripts\\ShotManager\\Shot01.xml");

Or better yet, use forward slashes instead:

var XMLfile = new File("T:/__SharedAssets/Assets_AE/Scripts/ShotManager/Shot01.xml");

Votes

Translate

Translate
Advocate ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

What would this return?

var XMLfile = new File("T:\__SharedAssets\Assets_AE\Scripts\ShotManager\Shot01.xml");

alert(XMLfile.exists);

If it returns false, witch it probably will, try escape slashes in the path: "\" to "\\":

var XMLfile = new File("T:\\__SharedAssets\\Assets_AE\\Scripts\\ShotManager\\Shot01.xml");

Or better yet, use forward slashes instead:

var XMLfile = new File("T:/__SharedAssets/Assets_AE/Scripts/ShotManager/Shot01.xml");

Votes

Translate

Translate

Report

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
Community Beginner ,
Sep 02, 2017 Sep 02, 2017

Copy link to clipboard

Copied

LATEST

Hi Tomas,

Thanks a lot! Should have tried that myself, both options work absolutely fine

Votes

Translate

Translate

Report

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