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!
1 Correct answer
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");
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");
Copy link to clipboard
Copied
Hi Tomas,
Thanks a lot! Should have tried that myself, both options work absolutely fine

