3 Replies Latest reply on Sep 23, 2009 1:21 PM by Kasyan Servetsky

    Search Words in a special Section in InDesign

    Patrick.Karre
      Dear All,

       

      I have the following problem. I have an InDesign document that has two columns. I have a script that has always in the entire document looking for words. However, the script should search only the words in the left column. How can I implement it that only a certain area is included on each page in the search?

       

      Thank you for your help.

       

      Greetings
      Patrick P. Carré
        • 1. Re: Search Words in a special Section in InDesign
          Kasyan Servetsky Level 5

          In the following example I assume that you have only one text frame on the 1st page and it has 2 columns:

           

          var myDoc = app.activeDocument;
          var myTextFrame = myDoc.pages[0].textFrames[0];
          var myTextColumn = myTextFrame.textColumns[0];
          app.findTextPreferences = app.changeTextPreferences = null;
          app.findTextPreferences.findWhat = "dog";
          app.changeTextPreferences.changeTo = "cat";
          myTextColumn.changeText();
          app.findTextPreferences = app.changeTextPreferences = null;

          • 2. Re: Search Words in a special Section in InDesign
            Patrick.Karre Level 1

            Thanks.

             

            I need to create an index with a script. This works so far. I have the problem that I can only take words from the first column. The second column should not be used.

            Your script is to replace the super, but how can I solve my problem best.
            • 3. Re: Search Words in a special Section in InDesign
              Kasyan Servetsky Level 5

              It's hard to give you some advice without seeing your script and running it with your document open.

              I guess it looks for words that are somehow marked — e.g. with a character style — and then found words are converted to index entries.

              To perform a search operation in the left column (aka Text Column #0 or the 1st Text Column) of a  text frame consisting of 2 or more columns you can use the following syntax:

               

              myTextFrame.textColumns[0].findText();