Skip to main content
Known Participant
September 12, 2024
Question

how to call evalFile with parameter using evalScript?

  • September 12, 2024
  • 1 reply
  • 718 views

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.

 

This topic has been closed for replies.

1 reply

Community Manager
September 12, 2024

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

 

Known Participant
September 13, 2024

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.

Community Manager
September 18, 2024

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