Skip to main content
Participant
September 4, 2017
Answered

CEP hello world returns "EvalScript error"

  • September 4, 2017
  • 1 reply
  • 8719 views

Hello all

This is my first CEP panel and I'm struggling with the EvalScript call.

Here are my index.html, manifest.xml, .debug contents CEP AE Hello World issue — Bitbucket

The panel is visible in Windows > Extensions. It loads fine and displays the initial alert();

This block

var csInterface = new CSInterface();

   csInterface.evalScript('app.project.file.displayName', function (result) {

   alert(result);

  });

returns "EvalScript error."

Using the debug console via a browser on the debug port shows no message.

I'm aware that app.project is null when project has not been saved, so I launch the panel after a dummy project is loaded.

I'm using After Effects 2017.2, CSInterface - v6.1.0 and my core.jsx is empty

I've followed the guide to allow unsigned panels to be launched in CC apps

What newbie task have I not completed?

Thanks

This topic has been closed for replies.
Correct answer activepixels

I just saw that your script is executed immediately when the CEP panel starts. Does it work if you run the code when a button of your panel is clicked? I guess at the point in time when the html of the CEP panel is loaded, the panel is not yet properly initialized and ready to eval scripts.


The issue is solved. I was browsing non related questions on the forum and spotted this reply Re: Re: Create a Trial Extension?  by DBarranca​ saying "be aware that with HTML Panels a typo in the JSX makes the whole thing fail silently".

So I removed the manifest reference to my empty jsx file and the panel now functions. Have updated the repo in case it helps anyone else starting out

Thanks for helping out!

1 reply

Mathias Moehl
Community Expert
Community Expert
September 4, 2017

Maybe your currently open Ae project is not yet saved? In this case

app.project.file

is null and trying to access displayName of null causes an error.

I recommend to run app.project.file.displayName directly from ESTK (with Ae choosen as host app) and test whether this also gives an error or not.

Cheers,

Mathias

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Participant
September 4, 2017

Hi Mathias, thanks for replying

I have just run

alert(app.project.file.displayName);

in the extendscript toolkit editor window, and it correctly returns the file name of the current project. I then launched the hello world panel again and saw the same "EvalScript error."

activepixelsAuthorCorrect answer
Participant
September 5, 2017

I just saw that your script is executed immediately when the CEP panel starts. Does it work if you run the code when a button of your panel is clicked? I guess at the point in time when the html of the CEP panel is loaded, the panel is not yet properly initialized and ready to eval scripts.


The issue is solved. I was browsing non related questions on the forum and spotted this reply Re: Re: Create a Trial Extension?  by DBarranca​ saying "be aware that with HTML Panels a typo in the JSX makes the whole thing fail silently".

So I removed the manifest reference to my empty jsx file and the panel now functions. Have updated the repo in case it helps anyone else starting out

Thanks for helping out!