I do something similar with an annual directory of antique dealers. The way I do it is to make a second file (I use data merge) with just the names, one record per page, and then make a TOC from that file. I copy that TOC to the main file as an index by dealer number.
Can you show us screenshots of what kind of page you have and what you finally want as index for these pages?
I don't have access to the actual file but I created a file that replicates what I want to do do that I could take screenshots of it.
Here is a screenshot of the page.
And here is how I want my index to look.
Notice that the numbers after the leaders in the index are not page numbers but rather songs numbers that come from the very same page.
What you call "leaders" is the dots?
is the numbering continuous page after page: 1, 2, 3, …, n?
Yes, I am calling the dots leaders.
The numbering is continuous page after page with some pages having 1 song on them and some pages having two songs on them. Does this answer you questions?
And you want an index:
Of course, "aaaa", "bbbb", … aren't song real names!
How do you enter the numbering?
Yea, that’s what I’m after.
I am manually entering the numbers but assigning a paragraph style called “song numbers”.
So what exactly did you do?
I'm not a good teacher, but I try!
The idea: I index not "the song", but "the song + tabulation (leaders) and its number"!!
… Of course, the leaders and the number are "invisible" in the song title!
The "visible numbering" is a cross-reference to the invisible numbering! So we type once (in the invisible numbering) and we can place it where we want in the layout (e.g. anchored text block)!
When we generate the index, the para style applied has a grep style to make the page number "invisible".
So, the only thing to do after all that is to … simply generate the index!
Thank you very much!
This is very helpful!