Copy link to clipboard
Copied
Does someone know why if I JSON.stringify("You've won") it exports it like this??
cheers!
Copy link to clipboard
Copied
Export what from where? You need to be more specific and describe the exact situatiuon and include things like system info, langauge settings, character encodings ansd possibly even font info. Just throwing out such random bits is not useful to anyone.
Mylenium
Copy link to clipboard
Copied
You are right, sorry.
I have a layer in the composition with that text, so I'm reading it like this:
JSON.stringify(layer.property("ADBE Text Properties").property("ADBE Text Document").value.text)
Latest AE version
Windows 10 ENG
no encodig asfaik, I have not setup that
Funny thing is that now is working properly... I don't know what could have happend
Copy link to clipboard
Copied
From what environment are you calling JSON.stringify?
From CEP panel (JS) or ExtendScript (JSX)?
Copy link to clipboard
Copied
From extendedScript
Copy link to clipboard
Copied
Right, OK, let me jump ahead and say that by default JSON is not included in ExtendScript. Meaning, that it does not exist out of the box in ExtendeScript.
However, if you are still able to use JSON without specifically including it yourself, then this means that some other third tool is modifying global space and injecting JSON into the app. This is bad, and you should never rely on this.
If you need to use JSON in your script, you should always include it yourself:
1. Download this https://github.com/douglascrockford/JSON-js/blob/master/json2.js?
2. Then in your JSX file use include to load JSON into your local script scope: #include 'path/to/json2.js'
So now you end up with the JSON version that you can control, without relying on JSON injected by accident by third parties.
Copy link to clipboard
Copied
Thanks a lot for your answer and your help Tomas!
Copy link to clipboard
Copied
I've seen you around helping people, thank you so much for that.
I'm wondering if you know if the json2.js still works (https://github.com/douglascrockford/JSON-js/blob/master/json2.js?)?
I run Adobe After effects 2021 and Extendscript toolkit. I try to #include 'path/to/json2.js' but when I run Main flach at row 119, and result in = Result: undefined