5 Replies Latest reply on Jul 25, 2011 2:44 PM by [Jongware]

    Automatically Create Hyperlink Using Product Name in Document Text




      I've recently been told that all the product names in our PDF documents from here on out have to link to their product pages on our web site. This is a problem because any given document could contain dozens or a hundred references to products. Before I try my first attempt at creating an Indesign Script (on something that sounds kind of complicated for a novice like me) I was wondering if there any existing scripts out there that do something like the following:


      1. Find all instances in the text of product names beginning in AD and ending in either a number (digit) or the lowercase letter "x."
      2. Style those instances in a predefined URL character style (basically styling it in blue).
      3. Create a hyperlink to the product page using the product name found in the text. Taking the product name--AD4056, for instance--and creating a hyperlink by adding http://www.corpsite.com/ to the front of the URL and adding the product name to the end.


      So the end result, for example, would be that a product name like AD4056 would be set in the URL character style, and would have hyperlink added that, when in the exported PDF, would take you to the product page, http://www.corpsite.com/ad4056.


      It seems like it might be a relatively common problem, so I'm hoping that someone out there may have a resource already available. Oh, I'm on Indesign CS5 on a PC. Would prefer Javascript so our vendors could use it on a Mac, but PC-centric is OK too. If not, I'll get to crackin' on making it myself.


      Thanks in advance for any pointers!