Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there a way to search and replace text that is INSIDE Index markers

Enthusiast ,
Jul 22, 2025 Jul 22, 2025

Hi. Using ID 24.4.1 under Windows 11.

Summary question: I know how to search for Index markers, but when I do, the search-for box doesn't return results if I include any additional specific text. For instance the "search for index marker" -- ^I -- works fine but ^IABC does not find those index markers containing the text ABC. Maybe I'm just doing it wrong. It would not be the first time. How would I search for specific text WITHIN index markers?

 

Background: Client with a manual suite. Two products are very similar (only a name change, some screen shots, and reduction of features in #2). I copy over the big files from Product #1 and change the name for Product #2, suitably deleting the specific features and changing the requisite shots. Easy-peasy.

 

Product #1 has grown over the years, and this year I added an index, which will help with CS calls and RTFM. Now I bring the files over to Product #2 and would like to include the index there, too (why not, the markers are all present)... but the index markers refer to the Product #1 name often enough that I really don't want to have to comb through them manually. I can do that in the Index window. There are under a hundred name-specific markers. That may be the best answer. But then next year when we go through this process, I'll have to do it again -- I'd like to at least semi-automate. As an aside, it's not useful to maintain the two products as separate branches. Much easier to edit the big guy, copy over, change name, and delete.

 

So: Can the text WITHIN an index marker be searched for (and ideally, replaced)? And if so, how?

(I'll note that the ID forum somehow suggests this same topic for FrameMaker, which I haven't used in a while, now.)

 

Thanks as always to the community.

-j

TOPICS
How to
91
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2025 Jul 23, 2025
LATEST

You can't do that in the interface (other than the rudimentary method you described), you need a script for that. And it's pretty simple, see the script, below.

 

First enter the word changes at the top of the script, where you see 'chair':  'silla'. The first word is the original, the second word is the new form.

changes = {
  'chair': 'silla',
  'table': 'mesa'
};

topics = app.activeDocument.indexes[0].allTopics;
for (i = topics.length-1; i >= 0; i--) {
  if (changes[topics[i].name]) {
    topics[i].name = changes[topics[i].name];
  }
}

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines