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

Scripting: Is the JavaScript JSON class available for scripts by default?

Engaged ,
May 06, 2020 May 06, 2020

I'm writing a script and want to use JSON.stringify() etc., and I'm wondering if it is available as a built-in function for scripts (not talking about expressions here).

 

If I try it it works, but in the debugger it says that the definition is actually provided by the DUIK scripts that I have installed, so I don't know if 

JSON.stringify()

and 

JSON.parse()

will work on a machine that doesn't have DUIK installed (asking so I don't have to unistall and reinstall).

TOPICS
Scripting
2.8K
Translate
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

Advocate , May 06, 2020 May 06, 2020

No, JSON is not natively included in ExtendScript.

What we, script developers usually do, is use this library: https://github.com/douglascrockford/JSON-js/blob/master/json2.js?

Simply download this file, and the use #include 'path/to/json2.js' in your main script to use JSON features.

Translate
LEGEND ,
May 06, 2020 May 06, 2020

Nope. Those are clearly external node.js functions (or for that matter any of those fancy libraries using them).

 

Mylenium

Translate
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
Advocate ,
May 06, 2020 May 06, 2020

No, JSON is not natively included in ExtendScript.

What we, script developers usually do, is use this library: https://github.com/douglascrockford/JSON-js/blob/master/json2.js?

Simply download this file, and the use #include 'path/to/json2.js' in your main script to use JSON features.

Translate
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
Community Expert ,
May 07, 2020 May 07, 2020
LATEST

also see

https://aescripts.com/learn/After-Effects-Scripting-JSON-Tutorial/

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
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