Opening a file in InDesign from jsx
This seems trivial, but I can't seem to get InDesign to open a file.
I'm can pass a file path to the index.jsx using an evalScript:
// pasteFile is '/Users/me/Desktop/Blah/05_21_2018_PRODUCT/Blah_05_21_2018_PRODUCT.indd'
//csInterface.evalScript("openFile('" + JSON.stringify(pasteFile) + "')");
csInterface.evalScript("openFile('" + pasteFile + "')");
Then in the .jsx, I simply try to open it:
#include "json2.js"
function openFile(someFile) {
//var aFile = JSON.parse(someFile);
alert(someFile);
var docRef = app.open(someFile);
}
I read elsewhere that you need to JSON.stringify then JSON.parse an argument being passed to the jsx. Regardless, alert(someFile); works in both cases, and it alerts with the proper file path. app.open(someFile); appears to do nothing, however.
Any ideas?
