Skip to main content
Participant
September 23, 2009
Question

Search Words in a special Section in InDesign

  • September 23, 2009
  • 1 reply
  • 710 views
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é
This topic has been closed for replies.

1 reply

Kasyan Servetsky
Legend
September 23, 2009

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;

Participant
September 23, 2009

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.
Kasyan Servetsky
Legend
September 23, 2009

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();