Created
December 13, 2017 18:58
-
-
Save chulman444/de5982c0c9735ca15d067548482a05e4 to your computer and use it in GitHub Desktop.
ExtendScript read JSON file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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