Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

special characters makes trouble with bridge talk in loaded script

$
0
0

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:

 

script_standalone.png

 

 

 

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:

 

scriptBridgeTalk.png

 

What can I do to fix this?



Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>