0 Replies Latest reply on Aug 10, 2015 1:12 AM by ksatam

    I can't replace all contents in textFrames

    ksatam

      Hi.

       

      I have a problem, I wrote a script that has me replace all words in the selected textFrame on a letter. It seems to me that everything is fine, but once you start it turns out that it does not replace all the words.

       

       

       

      var zaznaczenie =app.activeDocument.selection;

       

      if (zaznaczenie[0].typename == "TextFrame" ) {

         

          $.writeln(zaznaczenie[0].contents);

          for(i=0;i<zaznaczenie[0].words.length;i++){

              var temp = zaznaczenie[0].words[i].contents;

              $.writeln(zaznaczenie[0].words[i].contents);

              var t=temp.replace (temp, "x");

              zaznaczenie[0].words[i].contents=t;

          }

      }

       

       

       

       

      THXScreen Shot 2015-08-10 at 09.56.58.png