1 Reply Latest reply on Oct 17, 2013 12:18 AM by Kasyan Servetsky

    Script or GREP exist? to find any number, create hyperlink to page from it?

    emmeh_d

      Hey all

       

      I'm looking for an existing script (or GREP) to search a section of text, find any digit and then create hyperlink to a page (with same number it has just found -- ie. turn that digit into a hyperlink to the page in the InDesign book of the same number.)

       

      Background = client supplied a huge table of 'cross references' to pages in a big report, I need each page number to be an active link to the page it refers to but don't want to do it manually.

       

      Would appreciate any advice!!!

       

      Thanks

        • 1. Re: Script or GREP exist? to find any number, create hyperlink to page from it?
          Kasyan Servetsky Level 5

          You can’t do this with GREP. But with script it’s possible. I did a lot of such work before: mostly creating hyperlinks from numbers in indexes to the text they refer, or to the page. Usually I created bookmarks (by script) at the beginning of each page naming them "page1", "page2" and so on. Adding a bookmark creates an anchor with the same name. Then I run another script which finds numbers and creates hyperlinks to the corresponding anchors. It was possible to make hyperlinks in complex indexes: e.g. pointing to four different volumes.

          The main difficulty here is that all books are different so it’s impossible to make a universal script that would work for all. You have to adjust it for each particular book.