9 Replies Latest reply on Jun 12, 2013 12:01 PM by pixxxel schubser

    special characters makes trouble with bridge talk in loaded script

    pixxxel schubser Level 5

      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:

       

      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?