Clean Up Index Topics

This script cleans up topic names in the Index panel so that you don´t have to clean up text in the generated story every time you regenerate the index. (It renames both entries: in Topic Levels and Sort By fields).

For example, say, I want to replace all N-dashes with M-dashes:

Before

clean_up_index_topics3.jpg

clean_up_index_topics1.jpg

After

clean_up_index_topics4.jpg

clean_up_index_topics2.jpg

This version makes only three types of replacement:

But you can adjust it to your needs. Edit, or duplicate and edit one of the following blocks of code:

clean_up_index_topics5.jpg

Add your GREP or text expressions (marked with yellow on the screenshot above). If you don´t know how to build a regular expression (GREP), you can ask this at the Adobe InDesign scripting forum.

When the script is running a progress bar appears and at the end an alert tells how many topic were renamed.

clean_up_index_topics6.jpg

Click here to download it.