Copy link to clipboard
Copied
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-window-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?
hmm...Davide says we can't use back slash (\) with BridgeTalk in the Link you provided...
...check this thread to see if you can't get something to work
Copy link to clipboard
Copied
hmm...Davide says we can't use back slash (\) with BridgeTalk in the Link you provided...
...check this thread to see if you can't get something to work
Copy link to clipboard
Copied
Hello CarlosCanto,
thank you for sharing the link. (Oh god, so much to read - and this with my English) ![]()
Copy link to clipboard
Copied
your English is fine, it is waaaaaaaaaaay better that my German ![]()
edit:
is it German? or Deutsch?
Message was edited by: CarlosCanto
Copy link to clipboard
Copied
Really fine or amusing?
![]()
CarlosCanto wrote:
… Deutsch?
Woah!
100% perfect grammar and orthography.
Certainly there are not so much people are able to imitate this result. ![]()
back to topic
In your link I have found what I was looking for.
Even if the subject matter was a completely different - probably is the "Backslash-BUG" also the cause. Now I use an alternative syntax for the special characters and everything works perfect.
Thanx
Copy link to clipboard
Copied
Certainly there are not so much people are able to imitate this result.
I'm not that smart...I googled that ![]()
Now I use an alternative syntax for the special characters and everything works perfect.
do you mind sharing how you solved it?
thanks
Copy link to clipboard
Copied
CarlosCanto wrote:
…do you mind sharing how you solved it?
thanks
No problem:
...check this thread to find the solution
Copy link to clipboard
Copied
I hope you'll forgive me the little joke.
![]()
![]()
![]()
There are several ways to (call) special characters about their unicode.
This linked thread has reminded me.
decodeURI()
unescape()
String.fromCharCode()
and so on …
I use the unescape-method.
Copy link to clipboard
Copied
hahaha, no problem, I did the same to you earlier
thanks for sharing
Copy link to clipboard
Copied
My pleasure,
and thanks for the help.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now