Here is some test code to help put my question in context:
OutputTo "_var0"
Say "{\"key0\":\"Scripting is \\\\\"hard\\\\\" work\","
SayNewline
Say "\"key1\":\"Scripting is \\\\\"HARD\\\\\" work\"}"
RegexpReplace "^.*" "%_var0%"
json "ON" "current"
json_select "key1"
SayRest
With this I can get "Scripting is "HARD" work" in _var0 output. What's interesting is the use of RegexpReplace to load the output's value:
Script-Line : ???
Command : regexpreplace
Parameter 1 : >^.*<
Parameter 2 : >{"key0":"Scripting is \\"hard\\" work",
"key1":"Scripting is \\"HARD\\" work"}<
Output : >{"key0":"Scripting is \\"hard\\" work",
"key1":"Scripting is \\"HARD\\" work"}<
Line and position:
{"key0":"Scripting is \"hard\" work",
"key1":"Scripting is \"HARD\" work"}
Notice that in ["HARD"] the double quote " special character -as part of the buffer string- is escaped, BUT inside the output memory there are 2 backslashes \\, and when loaded into the buffer there is only one \.
As I understand, the escape backslash for " is 'consumed' in order to preserve the special character, when loaded into the buffer.
My question is: is there a way to keep *ALL* characters when calling an output into the current buffer i.e. keeping the string exactly as it sits in the output's memory?
Thank you in advance.