Everytime I push an JSONObject onto an array, it adds quotation marks and backslashes.
I have turned off smart quotes.
For some reason it is wrapping the JSONObject with quotes, putting that into the array and then since it is detect two quotes instead of one, it escape the likely quote with a backslash.
Would be nice if someone could look at this pls,
JSON.kmmacros (6.1 KB)
JSON - push Object Onto a JSON Array.kmmacros (2.5 KB)
var json_object = km.getvariable("JSON Object");
A JSON value is just a String.
if you want to the bind the name
Incidentally, I think the confusion is already expressed in your macro title and variable names.
You can't "push an object onto a JSON array"
A JSON array is not an array.
Similarly in your code:
is not a "json array" (which would simply be a string representation of an array).
JSON is a serialization format – a string format.
The map is not the territory.