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

Function call from CEP panel stopped working today.

Community Beginner ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

I have been using this script for a while and today it stopped working. It is calling a function from a jsx that I had loaded earlier. csInterface is a new CSInterface created earlier as well. Does anybody know why this would happen? It just stopped working and nothing was done to the code.

csInterface.evalScript('CheckThis(' + yep + ');', function(res){
console.log(res);
});
TOPICS
Scripting

Views

75

Likes

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
Community Expert ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

Hi @johnh5264484 

Are you getting any error? If yes, could you please post your screenshot?

Best regards

Likes

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
Community Expert ,
Oct 15, 2022 Oct 15, 2022

Copy link to clipboard

Copied

In addition to what @Charu Rajput mentioned, if there is no error message and it just does not work silently then we need to make sure that the call is reaching the jsx method. For that the easiest way would be to add in an alert in your called jsx function definition and then test. If you get the alert when the call is triggered via csinterface then it means that the call is made but something in the code of jsx is failing, try commenting out pieces of code to figure out the culprit. If the alert is not shown then it means that the call never ended up in jsx land and you have some issues on the js end

P.S. :- Make sure you realunch Illustrator after making changes to jsx

-Manan

Likes

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
Community Beginner ,
Oct 17, 2022 Oct 17, 2022

Copy link to clipboard

Copied

The error message is this.

Screen Shot 2022-10-17 at 3.05.23 PM.png

This is the full code.

Screen Shot 2022-10-17 at 3.10.23 PM.png

The php pull is going through and I am getting a correct response from it. The evalScript is what is not working. The loadJSX() is from my main.js and it is just loading the file the function is from. This code had been working up until Friday. That being said I have a function call like this in another cep extension that does work. I also tried calling a function that was just an alert as a test in this cep extension and another one I have and they both failed. That is outside of an xmlhttp pull. Here is the loadJSX() code.

Screen Shot 2022-10-17 at 3.18.56 PM.png

Likes

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
Community Expert ,
Oct 17, 2022 Oct 17, 2022

Copy link to clipboard

Copied

Are you able to call other functions from this file or none of the methods from the file are accessible? It's difficult to point what needs to be looked at without having a look at the whole code and its structure. Can you remove pieces of code/file from this to create a shortest form of the extension that has this problem and does not contain anything that should not be shared publically and share that across, then I can have a look at it.

-Manan

Likes

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
Valorous Hero ,
Oct 18, 2022 Oct 18, 2022

Copy link to clipboard

Copied

On top of Manan's suggestions, the error seems to indicate that the CheckThis function couldn't be found. So at this stage, I would inspect the evalFile call. Is the file simply loaded?

try 

csInterface.evalScript('$.evalFile…', function(result){
console.log(result);
});

 The idea is to double check that the evalFile script did work properly. If it did cease to work, then something has changed. Either a file has been corrupted, moved or whatever.

Likes

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
Community Expert ,
Oct 18, 2022 Oct 18, 2022

Copy link to clipboard

Copied

Rightly said by @Loic.Aigon the key is that statement which loads the files. Having said that these issues are difficult buggers to solve, I have been in this situation myself as well and the only way I was able to get out of it was commenting out code portions and making the area to scan smaller and smaller untill the solution started staring you in the face 😛

-Manan

Likes

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
Valorous Hero ,
Oct 18, 2022 Oct 18, 2022

Copy link to clipboard

Copied

Developers who did :

alert(1);
…code
alert(2);
…code
alert(3);
…code

E6cjUzTXsAAU5eJ

 

Likes

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
Community Expert ,
Oct 18, 2022 Oct 18, 2022

Copy link to clipboard

Copied

LATEST

Count me in on this. This way of ancient debugging seldom fails you 🙂

-Manan

Likes

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