I have a table of contents textframe on the first page. In that same textframe, I have some intro text. When I click update TOC, it updates the TOC and replaces the intro text with the TOC. How do I keep the intro text?
I did a workaround (not sure if this is a good solution) where I created another textframe on top of the TOC textframe and put the intro text there.
However, sometimes, the intro text can be longer and can be overlapped and overset with the TOC textframe. How do I detect if the intro text is overset and if so to "resize it" vertically (at the same time reduce the TOC textframe size vertically)?
You could do it with a textwrap on the introtext-textframe.
To fit a textframe to content you can use this method in javascript:
myTextFrame.fit(FitOptions.FRAME_TO_CONTENT);