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
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
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!
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
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."
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.
Copy link to clipboard
Copied
<button onclick="displayProjectFileName()">Click me</button>
<script src="lib/CSInterface.js"></script>
function displayProjectFileName(){
var csInterface = new CSInterface();
csInterface.evalScript('app.project.file.displayName', function (result) {
I've moved the call to evalScript to a click event handler - same error message
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
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!
Copy link to clipboard
Copied
May i know what helped you fix the issue? can you give me a sample of the rewritten code?
Copy link to clipboard
Copied
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