This script is part of the Indexes and Concordances collection. See the full collection here.ย For more information about working with indexes and concordances in InDesign, see here.
Unlike subtopics, which InDesign sorts, cross-references are printed in the order in which they were added to the document. If you create a cross-reference to the topic UXP, and later, at the same topic, create a cross-reference to the topic JavaScript, then another one to AppleScript, the Index panel shows them in the order you created them:

After generating the index you’ll see that the cross-references weren’t sorted:

In addition, cross-references of the same type (See, See also) arenโt grouped. What we’re after is See also AppleScript; Javascript; UXP. In addition, subtopics are often placed after the page references:

This script fixes all these problems. Run it against a generated index.
It has no interface, but you need to set two parameters: the text (language) of the cross-reference label and whether the cross-references should be moved. The script defaults to See also and placing cross-references after page references. To change these settings, open the script in a plain-text editor and change these two lines, which are at the top of the script:
var xrefString = 'See also';
var moveCrossRefs = true;
Change 'See also' to e.g. 'Zie ook' and true to false. Save the script (as a plain-text file)
With See cross-references moving them isn’t relevant, so make sure that moveCrossRefs is false.
Return to Index Fixes page.
Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com
Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository
Contact Peter Kahrel
Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.
This article was last modified on September 5, 2026
This article was first published on September 5, 2026
Commenting is easier and faster when you're logged in!
Recommended for you
Master InDesign’s Smart Text Reflow
Just how does that Smart Text Reflow work in InDesign, anyway? For the longest t...
How to Create a Pie or Ring Chart in InDesign
Learn how to create a pie chart or a ring chart right inside of InDesign with th...
InDesign Can Create More Kinds of QR Codes Than You Think
With the right syntax, you can make QR codes that dial phone numbers, add calend...
