Copy link to clipboard
Copied
Hi,
I need to call evalFile with parameter using evalScript.
Folder Structure: C:\Program Files\Common Files\Adobe\CEP\extensions\MY_CUSTOM_CEP_EXT_001
CSXS
manifest.xml
client
index.html
style.css
index.js
CSInterface.js
host
index.jsx
loaderScript.jsx
images
META-INF
signatures.xml
node_modules
mimetype
In loaderScript.jsx
function getData_extcall(name, age) {
return JSON.stringify({'error': 0, 'name': name, 'age': age});
}
In client/index.js
var callExtFilePath = csInterface.getSystemPath(SystemPath.EXTENSION) + "/host/loaderScript.jsx";
csInterface.evalScript(`$.evalFile("${callExtFilePath}")`, function(result) {
console.log("Result Extcall : " + result + "\n\n");
});
Please help.
Copy link to clipboard
Copied
Hi there,
Sorry to hear you're having trouble.
Please double-check the path to ensure it’s being resolved correctly. Make sure the function is defined properly and is accessible in the script. You also need to ensure that the script correctly calls the function and the path is formatted.
Please brief us about the issue you are facing, so we can look forward to helping you on this.
Looking forward to hearing from you.
Thank you.
A.N
Copy link to clipboard
Copied
Hi Anshul_Nautiyal,
I need to pass the parameter to extendscript using evalFile. I don't know how to call and pass the parameter using evalFile. I tried multiple ways. Sometimes it returns a path not found an error or a name/age is an undefined error. I solved the path-related error. But parameter related error is still showing. Please help.
Copy link to clipboard
Copied
Hi there,
Sorry for the late response.
Can you please let us know you are trying this for which particular application? So we can help out better on this.
Thank you.
Regards,
A.N
Copy link to clipboard
Copied
Hi Anshul_Nautiyal,
I am using Adobe CEP 11 and node js. I run my plugin for fetching textframes with style properties from one ai file and closing it. Again i run the same plugin for another ai file, its show this error (an Illustrator error occurred: 1346458189 ('MRAP') ). This reason only i am try to use evalfile.