Skip to main content
Known Participant
December 11, 2024
Answered

script to link back the headings to the corresponding page of the TOC

  • December 11, 2024
  • 3 replies
  • 2059 views

Hello community,

I have one indesign file with a few thousand headings and I created the automatic TOC with this headings.
So far everything is perfect.
Now I should also create the link that when you click on any heading inside the file it takes you to the corresponding entry in the TOC (not to the first page of the TOC but to the page that contains that heading).
I know that it can be done manually but since there are a few thousand headings I was wondering if you know of any script that can solve this problem.
Thanks in advance

Marko

This topic has been closed for replies.
Correct answer Robert at ID-Tasker

In case of multiple separate chapters I could convert the automatic numbered content to text with, for example, this script
app.activeDocument.stories.everyItem().convertBulletsAndNumberingToText();
After that Robert, do you think you could provide a script that can connect the titles inside the file with the related entries that are in the TOC?
Thanks a lot
Marko

 


@marko_5038 

 

Almost done:

 

(I had to create few extra rules)

 

My tool isn't free, but I can either give you access to the full version for some time - or you can send me your final file and I'll convert it for you for free.

 

Do you want hyperlinks from 1st part - Questions - point to the corresponding page in Answers - or to specific text / paragraph in Answers?

 

3 replies

Known Participant
December 12, 2024

@Robert at ID-Tasker 

I add that the original file contains several thousand questions. The answers are instead in the TOC

Robert at ID-Tasker
Legend
December 12, 2024

@marko_5038

 

Can you share a sample file? 

 

Known Participant
December 12, 2024

Hi Robert,
I am sharing a sample indd file and a pdf file.
The TOC called "Answers" here is from page 7 onwards. Clicking on the titles of the TOC opens the relative page inside.

I should also create the link that when you click on any Title inside the file it takes you to the corresponding entry in the TOC (not to the first page of the TOC but to the page that contains that Title).
Thanks a lot

Robert at ID-Tasker
Legend
December 13, 2024

@marko_5038

 

The "problem" is - you have auto-numbered lists in the 1st part - and static numbers in the second part... 

 

If it's not a problem to convert first ones into static - of course it can be done by the script - then it would be a piece of cake to link back.

 

Community Expert
December 11, 2024

Not sure if this will work for you

https://www.id-extras.com/products/livetoc/

 

Seems to be a solution to link the Headers back to the TOC

 

 

Known Participant
December 11, 2024

Hi Eugene, thanks a lot for your advice.

However it seems that this script can't link the headers back to the TOC

I hope @TᴀW  (Ariel from id-extras) can give us the definitive answer if this great script does what I need.
Thanks again
Marko

Community Expert
December 11, 2024

I read through the comments and it seems they were asking similar there and got some instructions.

Maybe I read it wrong .