5 Replies Latest reply: Jun 20, 2012 2:38 PM by [Jongware] RSS

    Get referenced pages of every pageReference in Index


      Hi there!

      I'm working on a script that attempts to review all page references on each topic of an index in order to remove duplicates and build page ranges...

      So far I get the referenceType for each pageReference, but it only returns the 'referenceType' and not the current page as the Indesign 8 Object Model says:


      PageReferenceType.CURRENT_PAGE  (Read Only)

      Data Type: number , Value: 1668444263

      Adobe InDesign CS6 (8.0) Object Model

      The page on which the index entry is located.


      The followin script write in console each topic's name and its references (as 1668444263 if is of type CURRENT_PAGE), and I would like to get the real current page number...


      Any help really appreciated!!


      var index = app.documents[0].indexes[0];

      for (i = 0; i < index.topics.length ; i++)


          $.write("Topic: " + index.topics[i].name + "\n");

              for (t = 0; t < index.topics[i].pageReferences.length ; t++)


                  var pRef = index.topics[i].pageReferences[t].pageReferenceType;

                  $.write(pRef + "\n");