[JS] Toc makeAnchor

Enthusiast ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Good morning all How is it possible to retrieve the information from the anchor text (make text anchor in source paragraph.) That the table of contents insert when the option is checked?

 

I have nothing on the command:

leDoc.hyperlinks[lePosition].properties

and no longer on:

leDoc.hyperlinks[lePosition].destination.properties

 

thank you

Liphou

 

Bonjour à Tous

Comment est-il possible de recupé les informations de l'ancre de texte (make text anchor in source paragraph.) que le table des matière inser quand l'option est coché ?

 

je n'ai rien sur la commande :

leDoc.hyperlinks[lePosition].properties

et non plus sur:

leDoc.hyperlinks[lePosition].destination.properties

 

merci à vous

 

Liphou

 

TOPICS
Scripting

Views

163

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 09, 2021 Jun 09, 2021

Copy link to clipboard

Copied

Hi Liphou,

I'm a little confused. What exactly are you after?

Could you post a screenshot showing that part of a TOC with invisible characters and the Story Editor window?

What information do you want to retrieve?

 

Thanks,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 09, 2021 Jun 09, 2021

Copy link to clipboard

Copied

 

 

 

Hello Laubender,

I am trying to retrieve the information on the text anchors that the table of contents when the option is selected: "Create a text anchor in the source paragraph", retrieve the information on these Anchors which links them with the table.

 

Merci

 

Liphou

 

Bonjour Laubbender,

 

Je cherche à récupérer les informations sur les ancres de textes que la table des matièrs quand l'option est selectioné : " Créer une ancre de texte dans le paragraphe source", récupérer les information sur ces Ancres qui les lie avec la table.

 

Capture d’écran 2021-06-10 à 08.36.40.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

Hi Liphou,

are you sure that you are really after the option

"Make text anchor in source paragraph" ?

 

That feature was introduced with InDesign version 9. The first version of Creative Cloud.

Before, e.g. with InDesign CS6 version 8, this feature did not exist.

 

Nevertheless, InDesign's TOC feature added hyperlinks to a document when the TOC was built in CS6.

With text anchors in the source paragraphs. And this is still the case with InDesign CC 2021.

 

 

hyperlink.source.sourceText
hyperlink.source.name

 

 

should give you the needed information.

 

And you will see, that:

 

hypelink.visible

 

returns false in the case of a hyperlink that was added with the TOC functionality of InDesign.

 

 

hyperlink.destination

 

 

will return a HyperlinkPageDestination.

 

You now know the building blocks of a Table Of Contents in a document.

 

FWIW:

"Make text anchor in source paragraph" is an option, it is part of a TOCStyle and was, as I already said, introduced with InDesign version 9. In the ExtendScript DOM you can turn that option on and off with:

 

TOCStyle.makeAnchor

 

Set makeAnchor to true or false. It has no influence on adding hyperlinks to the document when a TOC is added or updated.

 

What's left? Hm…
What is the real purpose of option "Make text anchor in source paragraph" in a TOC style?

My guess is, this is for an output format like EPUB perhaps. Documentation does not mention this option at all:

https://helpx.adobe.com/in/indesign/using/creating-table-contents.html

 

And DOM documentation does not tell a bit more:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#TOCStyle.html

 

Maybe I detected a glimpse of information in James Wamser's New Features of InDesign pdf:

 

Adobe InDesign CC | June 17, 2013
Version 9.0
EPUB enhancements
New features make it easier to produce high-quality EPUB files from InDesign.

You have greater control over the table of contents and CSS export, and CSS editing is simpler.…

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
13 hours ago 13 hours ago

Copy link to clipboard

Copied

LATEST

Hi Uwe,

 

>What is the real purpose of option "Make text anchor in source paragraph" in a TOC style?

>My guess is, this is for an output format like EPUB perhaps

 

Correct: InDesign uses it to create a multi-level TOC when a document is exported to Epub.

 

P.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines