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. 😊
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
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
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.
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.
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?
Copy link to clipboard
Copied
Here is fine, and/or directly to me (bbb@adobe.com)