Highlighted

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

Explorer ,
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

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

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 )

Topics

Scripting

Views

79

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

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

Explorer ,
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

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

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 )

Topics

Scripting

Views

80

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
Adobe Community Professional ,
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 )

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

Copy link to clipboard

Copied

Hi Uwe,

 

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

Thank you for your explanation.

 

Regards,

Tak

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
Reply
Loading...