Question
Accessing local file contents from JSX
Hi all,
From my panel (IDSN) I am generating a PDF file which I need to upload to a file service, however I am having issues reading the file from both JS and JSX.
The code below will excute just fine when being run from within InDesign but not from the panel – I get an this error "EvalScript error".
var theFile = File(path);
var fileString;
if (theFile.open('r')) {
try {
fileString = theFile.read();
} catch (err) {
console.log("Error\r" + err);
} finally {
theFile.close();
}
} else {
console.log("Error\rFile could not be opened.");
}
return fileString;
Does anybody know to acecss local files for submission?
