4 Replies Latest reply on Nov 29, 2016 7:15 AM by Kasyan Servetsky

    How can I automatize hyperlink creation?


      Hi all. I have a tool catalog of 3,000 pages which originally was to be printed; however, the client now wants every product in this catalog to link back to each product's page on their website. Is there any way that I can automatize this process so I don't have to link every product manually? I realize there is the script function, but I have zero knowledge about scripting. There's gotta be an easier way?

        • 1. Re: How can I automatize hyperlink creation?
          Kasyan Servetsky Level 5

          Hi there,


          Of course it's possible. I made a number of scripts for the purpose. A few of them I posted on my site, for example:

          Make hyperlinks from URL

          Scripts for making hyperlinks

          See also the 'Hyperlink' section here.

          It's difficult for me to give you a specific advice because you didn't post some screenshots or samples, but I guess each product has a unique code number which can be used for GREP search and making a hyperlink. You may have a data base/excel/etc. file containing the info about the product numbers and their URLs which can be used by script.

          Since you have zero knowledge about scripting, I recommend you to hire a scripter who can develop a script, or adjust an existing one for you.


          — Kas

          • 2. Re: How can I automatize hyperlink creation?
            Jamesmuzquiz Level 1

            hi Kas  I download from your website the  auto hyperlink script but only make 3 hyperlinks on the document and then do this

            Captura de pantalla 2016-11-29 a la(s) 00.40.43.png


            i errase the line 90 and works doing the hyperlinks on the text but not in the urls

            • 3. Re: How can I automatize hyperlink creation?
              Kasyan Servetsky Level 5

              I am not the author of the script: I took it from the forum, or maybe from this site. (This is its author).

              The script was tested in CS3 but you're on CC. Something may have changed since then.

              Maybe you have something in your layout that prevents the script from working properly.


              — Kas

              • 4. Re: How can I automatize hyperlink creation?
                Kasyan Servetsky Level 5

                I google-translated the error message from Spanish:

                ya hay otro objeto con ese nombre means There is already another object with that name

                I think this happens because you have several hyperlinks with the same name. Removing line 90 is a quick & dirty solution in this situation, but you'll get generic names.

                Alternatively you may generate a random number and add it to the name. I used this approach (BTW it's also quick & dirty here). See the screenshot at the very bottom of the page.

                You may modify the line 90 like so:

                myHyperlinkDestination.name = myURL + "_" + String(Math.random()).replace(/^0\./, "");

                which should give you a unique name for each destination.


                Last note: I don't have your file so can't test it and tell you what exactly goes wrong; it's only guessing.


                — Kas