• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is there a way to view page reference (topic) information based on index markers?

Explorer ,
Jun 20, 2020 Jun 20, 2020

Copy link to clipboard

Copied

I want to search for index markers and figure out what topics the markers correspond to.

I need to do this in sequential order (in the order the index markers appear in the text).

Is there a way to do this in script?

 

 

        Dim myInDesign As InDesign.Application
        myInDesign = CreateObject("InDesign.Application")

        myInDesign.FindGrepPreferences = InDesign.idNothingEnum.idNothing
        myInDesign.ChangeGrepPreferences = InDesign.idNothingEnum.idNothing
        myInDesign.FindGrepPreferences.FindWhat = "~I"

        Dim myDocument As InDesign.Document
        myDocument = myInDesign.ActiveDocument
        myFound = myDocument.FindGrep()
        For iFound = 1 To myFound.Count Step 1
            ' myTopic = myFound(iFound).Topic.Name  <---- Here
        Next

 

 

Thanks.

Tak

TOPICS
Scripting

Views

256

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

correct answers 1 Correct answer

Community Expert , Jun 22, 2020 Jun 22, 2020

Hi Tak,

yes there is a method to do it:

The first insertion point of a found index marker is exactly the source text of a page reference of a topic.

 

So you could loop the allTopics array ( if that exists in your used language ) of the index in your document:

For every topic with page references: Loop the page references collection and compare sourceText with the first insertion point of your found index marker.

 

Sorry, but I cannot give you any code with your scripting language, I'm just an E

...

Votes

Translate

Translate
Community Expert ,
Jun 22, 2020 Jun 22, 2020

Copy link to clipboard

Copied

Hi Tak,

yes there is a method to do it:

The first insertion point of a found index marker is exactly the source text of a page reference of a topic.

 

So you could loop the allTopics array ( if that exists in your used language ) of the index in your document:

For every topic with page references: Loop the page references collection and compare sourceText with the first insertion point of your found index marker.

 

Sorry, but I cannot give you any code with your scripting language, I'm just an ExtendScript writer.

So allTopics and sourceText may or may not exist with that wording in your language.

 

Regards,
Uwe Laubender

( ACP )

Votes

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
Explorer ,
Jun 22, 2020 Jun 22, 2020

Copy link to clipboard

Copied

LATEST

Hi Uwe,

 

That makes sense. allTopics is available so I should be able to code it.

Thank you for your explanation.

 

Regards,

Tak

Votes

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