AE Scripting: file.exists, file.open, file.close is undefined
Hi,
I have an automation script that reads from a json file to do various things. For months, the utility function which reads the json file has worked perfectly. Suddenly today, it's causing an error that
"file.exists is undefined", same for file.open() and file.close()
What the hell is going on? It's prbably something stupidly simple but I can't solve it.
var jsonfile= File("X:/some/path/this.json");
jsondata = readJson(jsonfile)
function readJson(file){
if (file.exists()){
file.close() //if left open
file.open("r");
while(!file.eof){
line = file.readln() ;
data.push(line) ;
data = data.join("") ;
var parsedData = JSON.parse(data);
return parsedData ;
}
file.close();
}
}
