Copy link to clipboard
Copied
I've been working on a custom tools CEP panel for premiere at our studio. I've learned a lot about extendscript over the last year and our panel is getting pretty neat.
Now I want to add functionality using ecternal JSON files exported from our planner software. What I want to do is read names from the JSON file that will be used to create new sequences with those names in Premiere.
My problem is that I can't figure out how to read the JSON files. I've been reading about the fact that extendscript doesn't support JSON by default. Including the json2.js file (like I did in one of my After Effects scripts) doesn't seem to work in Premiere.
Hopefully someone can help me in the right direction, thanks!
Copy link to clipboard
Copied
Can't you use the standard javascript JSON.parse()?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I found a solution. To get some JSON functionality into premiere CEP, you need to include this json.jsx in your panel's main jsx file: https://github.com/indiscripts/extendscript/tree/master/JSON
In my panel's Premiere.jsx i have this code and it works perfect:
#include "json.jsx";
var jsonFile = File(pathToJSONFile);
jsonFile.open('r');
var content = jsonFile.read();
jsonFile.close();
contentObj = JSON.eval(content);
Now 'contentObj' is an object with all the data from the JSON file.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied