Skip to content

Instantly share code, notes, and snippets.

@chulman444
Created December 13, 2017 18:58
Show Gist options
  • Select an option

  • Save chulman444/de5982c0c9735ca15d067548482a05e4 to your computer and use it in GitHub Desktop.

Select an option

Save chulman444/de5982c0c9735ca15d067548482a05e4 to your computer and use it in GitHub Desktop.
ExtendScript read JSON file.
# I needed this for my own AfterEffects Script.
// Use absolute path for the JSON file.
path = '/d/path/to/your/json/file.json'
// Get file object
file = File(path);
// open it before reading.
file.open('r');
// Read and get the content
content = file.read();
/// Extend script doesn't support JSON. Are you fucking kidding?
// obj = JSON.parse(file.read());
// Worry not. We got potentially harmful, yet useful, `eval` function.
stuff = eval("(" + content + ")")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment