Include .jsx local libraries in main.jsx
Hi,
I am trying to include the file myFunc.jsx which has local functions I created.
It contains e.g:
function getDocName() {
return app.documents.length ? app.activeDocument.name : "No docs open!";
}
getDocName is used in my main.js file:
function f_DocName() {
var csInterface = new CSInterface();
$("#btnDocName").click(function () {
csInterface.evalScript('getDocName()', function (result) {
$("#folderName").val(result);
});
});
}
I tried to load the jsx in my main.js file like this:
function loadJSX() {
var csInterface = new CSInterface();
var extensionRoot = csInterface.getSystemPath(SystemPath.EXTENSION) + "/host/include/";
csInterface.evalScript('$._ext.evalFiles("' + extensionRoot + '")');
}
And of course I call loadJSX() in my init function.
But getDocName() was not recognized, not unless i defined it in my main.jsx file
What is the right way to include jsx files with local function to be accessed from within main.js ?
Thank you
