Why is this so and what can I do?
I use several scripts in Illustrator. Some of them I use in this way:
http://www.davidebarranca.com/2012/11/scriptui-bridgetalk-persistent-w indow-examples/
Now I tried to built in two other scripts in the palette. In this scripts it is required to use special characters in variables. Standalone these scripts are work correct.
Here is an simple example:
// exampleScript.jsx
var a = '\u201d'+" example "+'\u201d';
alert(a)
I get this (correct) result:
But when I call this example script with bridge talk:
var scriptToLoad = new File(pathToScript + "/exampleScript.jsx");
var win = new Window('palette', 'own palette');
var btnSelect = win.add('button', undefined, 'example');
btnSelect.onClick = function(){scriptToLoad.open("r"); var bt = new BridgeTalk;
bt.target = "illustrator"; var script = scriptToLoad.read();
scriptToLoad.close(); bt.body = script; bt.send();}
win.center();
win.show();
Here is the same script and the wrong result:
What can I do to fix this?