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

json.jsx is only usable when Premiere open the project (CEP)

Participant ,
Dec 05, 2020 Dec 05, 2020

Copy link to clipboard

Copied

Hello,

 

I'm using the json.jsx (https://github.com/indiscripts/extendscript/blob/master/JSON/json.jsx) polyfill to debug and for callbacks in my CEP-extension. I included the code with "#include 'json.jsx'" at the beginning of my host.jsx.  But it just won't work right.

 

I'm not sure if this is the right place to put it, since this was made by another programmer. But my issues seem less with code itself, but with the fact, that the JSON object is only available right when Premiere  started and loaded the project. I currently only have one call of the JSON() -> which can be used as a shorthand for JSON.lave() (also only works on a fresh start of Premiere) method, which is used inside an alert. When i refresh my code / restart the plugin I following the error:

*Exception:ReferenceError: Object is not a function*
When I restart Premiere, there is no issue and the code works as intended. When I try to make a debug run with some tests i wrote via VS Code debug it fails as well.

Runtime Error: Error Code# 24: Object is not a function

This is marked, where the JSON object is referenced. 

 

Any guesses on why this is happening and why the JSON object looses it reference are very much appreciated.

 

Thank you. 😊

 

 

 

TOPICS
SDK

Views

496

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

Adobe Employee , Dec 05, 2020 Dec 05, 2020

The JSON object available via ExtendScript is only present when the CC Libraries panel is open; do not rely upon it. 

Many panel developers have had success using Douglas Crockford's json2.js. 

https://github.com/douglascrockford/JSON-js


Votes

Translate

Translate
Adobe Employee ,
Dec 05, 2020 Dec 05, 2020

Copy link to clipboard

Copied

The JSON object available via ExtendScript is only present when the CC Libraries panel is open; do not rely upon it. 

Many panel developers have had success using Douglas Crockford's json2.js. 

https://github.com/douglascrockford/JSON-js


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 ,
Dec 05, 2020 Dec 05, 2020

Copy link to clipboard

Copied

Yeah, I've used json2,js in another project before and it worked without issues.

Is there a way to force open the CC Libaries panel? But I guess the json2.js will do the job as well.

 

Thank you for your reply.

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
Adobe Employee ,
Dec 06, 2020 Dec 06, 2020

Copy link to clipboard

Copied

Is there a way to force open the CC Libaries panel?


A PPro CEP panel can force PPro to use a Workspace, in which CC Libraries is open. But yes, building json2.js into your panel is the more reliable option.

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 ,
Dec 06, 2020 Dec 06, 2020

Copy link to clipboard

Copied

Thanks.

json2,js works without issues now.

 

Offtopic: I found some methods which aren't documented in the latest Premiere Pro Scripting Guide, but exist in your sample project. Where is the best place to report this?

 

 

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
Adobe Employee ,
Dec 07, 2020 Dec 07, 2020

Copy link to clipboard

Copied

LATEST

Here is fine, and/or directly to me (bbb@adobe.com)

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