grefel
8/12/2014 - 9:34 AM

Escaping JSON String from ExtendScript toSource()

Escaping JSON String from ExtendScript toSource()

var myObject = {text:"a\rz"};
var json = myObject.toSource().replace(/\r/g,"\\r");
var myObject2 = eval(json);
$.writeln(myObject2.text)