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

Why is console undefined in com.adobe.PProPanel?

Participant ,
Apr 19, 2017 Apr 19, 2017

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?

TOPICS
SDK

Views

1.8K

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

Participant , Apr 19, 2017 Apr 19, 2017

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

Votes

Translate

Translate
Participant ,
Apr 19, 2017 Apr 19, 2017

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

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
Participant ,
Apr 19, 2017 Apr 19, 2017

Copy link to clipboard

Copied

Thanks Thomas, that makes sense.

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
Explorer ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

LATEST

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);

};

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