Copy link to clipboard
Copied
If I add a console.log statement to the PProPanel > Premiere.jsx file then when running in PP I get "script error: console is undefined" when I'm using Chrome and viewing on the port defined in the .debug file.
But if I add console.log to this example
https://github.com/ThomasSzabo/Minimalistic-Adobe-Premiere-Pro-Panel​
then it works as expected.
Sure I can use $.writeln() and view a log in ExtendScript Toolkit, but why doesn't it work in PProPanel?
Hey Martin,
may I ask where in the example code you're adding a console.log?
All jsx files are living in the ExtendScript context. Please do not confuse ExtendScript with JavaScript. ExtendScript uses JS syntax but is not JS. The console object does not exist in the ExtendScript world - only in JavaScript. So if you added console.log to the index.html, then you're in the HTML context of the Premiere Panel - not ExtendScript.
I hope this helps.
Thomas
Copy link to clipboard
Copied
Hey Martin,
may I ask where in the example code you're adding a console.log?
All jsx files are living in the ExtendScript context. Please do not confuse ExtendScript with JavaScript. ExtendScript uses JS syntax but is not JS. The console object does not exist in the ExtendScript world - only in JavaScript. So if you added console.log to the index.html, then you're in the HTML context of the Premiere Panel - not ExtendScript.
I hope this helps.
Thomas
Copy link to clipboard
Copied
Thanks Thomas, that makes sense.
Copy link to clipboard
Copied
In ExtendScript (at least for Premiere), you can use $.writeln() to log messages to the ExtendScript Toolkit's console.
Alternatively, polyfill console.log like so:
var console = console || {};
console.log = function (message) {
$.writeln(message);
};