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

CEP hello world returns "EvalScript error"

Community Beginner ,
Sep 04, 2017 Sep 04, 2017

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

6.3K

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

correct answers 1 Correct answer

Community Beginner , Sep 05, 2017 Sep 05, 2017

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!

Votes

Translate

Translate
Community Expert ,
Sep 04, 2017 Sep 04, 2017

Copy link to clipboard

Copied

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

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
Community Beginner ,
Sep 04, 2017 Sep 04, 2017

Copy link to clipboard

Copied

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."

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
Community Expert ,
Sep 04, 2017 Sep 04, 2017

Copy link to clipboard

Copied

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.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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
Community Beginner ,
Sep 04, 2017 Sep 04, 2017

Copy link to clipboard

Copied

<button onclick="displayProjectFileName()">Click me</button>

   <script src="lib/CSInterface.js"></script>

   <script>

   alert('hello');

   function displayProjectFileName(){

   var csInterface = new CSInterface();

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

   alert(result);

   });

   }

   </script>

I've moved the call to evalScript to a click event handler - same error message

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
Community Beginner ,
Sep 05, 2017 Sep 05, 2017

Copy link to clipboard

Copied

Hi Mathias,

I've created a repo with the panel contents and tried the panel on a different mac with the same error message

activepixels / CEPHelloWorld — Bitbucket

Could it be versioning between CSInterface, After Effects, CEP engine?

Thanks

Sean

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
Community Beginner ,
Sep 05, 2017 Sep 05, 2017

Copy link to clipboard

Copied

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!

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
New Here ,
Feb 05, 2021 Feb 05, 2021

Copy link to clipboard

Copied

May i know what helped you fix the issue?  can you give me a sample of the rewritten code?

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
New Here ,
Sep 13, 2022 Sep 13, 2022

Copy link to clipboard

Copied

LATEST

adding to an old thread:I just faced the same problem, the log file mentioned a decode error. The solution was to save the file as utf8 rather than ascii

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