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

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

Engaged ,
May 06, 2020 May 06, 2020

Copy link to clipboard

Copied

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

Views

2.3K

Translate

Translate

Report

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.

Votes

Translate

Translate
LEGEND ,
May 06, 2020 May 06, 2020

Copy link to clipboard

Copied

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

 

Mylenium

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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