3 Replies Latest reply on Sep 27, 2013 8:34 AM by OlivierMagny

    How to find specific text in a text frame, then replace it?

    OlivierMagny

      Hi,

       

      I'm currently using InDesign CC, specially the scripting part, to update a Price List for my company.

       

      I have an array that contains all the text frames from my document. One page use one text frame. I want to browse all these text frame, find a word and then replace it with the word I want to.

       

      Example: The line, in a text frame that contains multiple line, "CAR56974 - $14.95" must be change to  "CAR56974 - $18.66".

       

      I want to find that line in all my text frames, then replace it with the new line.

       

      I looked in the forums but couldnt find a specfic answer for my problem.

       

      Here is how I get all my text frames:

       

      var allTextFrames = myDoc.textFrames;

       

      for(var i=0;i<allTextFrames.length;i++){

               tf = allTextFrames[i];

      }

       

      Thanks in advance!

       

      Olivier

       

      EDIT: I use JavaScript.