• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how to call evalFile with parameter using evalScript?

Explorer ,
Sep 12, 2024 Sep 12, 2024

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.

 

Views

202

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Adobe Employee ,
Sep 12, 2024 Sep 12, 2024

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 12, 2024 Sep 12, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 18, 2024 Sep 18, 2024

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 19, 2024 Sep 19, 2024

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines