In such cases I use—even it is more work—cross references.
But I have used other methods too, like invisible text which will create the TOC automatically, e.g. I create a 3rd paragraph with automatic text variables which are taking the number and the hymn title from the prvevious paragraph automatically, this paragraph style has no color and can have any size and this paragraph style is used to create the TOC.
For editing purposes you might change the paragraph style temporarily to a visible paragraph style.
Thank you for your quick response. I have been trying several methods over the last few days.
Method 1: I created anchored text objects (with an attribute on non-printing), which I use to place notes in the outside margins of the text frames. I then type the hymn number and the hymn title into the note, with a tab character betweeen the two of them. Each object is anchored at the end of the text, just before the paragraph mark. I have the following paragraph styles in my Table of Contents:
Mass settings (major header) Heading level 1
Hymn information (intermediate header) Heading level 2
When I generate the table of contents, the problem is that the ordering is wrong. This is because anchored objects have a ordering that is established when one creates the object. However, I could not find how I could re-order the order of the objects. From some other forum items I read, I discovered that this ordering is not the same at that of the objects in the the layers palette.
How can one change the ordering of the anchored objects, so that they occur in the correct order in the Table of Contents.
Method 2: How does one use an "automatic text variable" to select a portion of the text from a preceding paragraph? I would like to try this method when I get a chance.