Automatically Create Hyperlink Using Product Name in Document Text

Hi,
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:
Find all instances in the text of product names beginning in AD and ending in either a number (digit) or the lowercase letter "x."
Style those instances in a predefined URL character style (basically styling it in blue).
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!

Here you are. As you see, it's quite complicated -- InDesign needs a destination URL, a virtual hyperlink, and an instance of this virtual hyperlink. All in all it took me a couple of tries before I got it right. (It didn't help your example URLs don't exist yet )
d = app.activeDocument;
url_style = d.characterStyles.item("URL style name");
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\<AD\\w+[\\dx]\\>";
sourceList = d.findGrep();
for (l=0; l<sourceList.length; l++)
     link = d.hyperlinkURLDestinations.add ( "http://www.corpsite.com/"+sourceList[l].contents);
     d.hyperlinks.add ( d.hyperlinkTextSources.add (sourceList[l]), link ).name = sourceList[l].contents+" ("+l+")";
     sourceList[l].appliedCharacterStyle = url_style;

Similar Messages

  • Automatically Create Hyperlink Using Product Name in PDF text

    Hi,
    I've recently been told that all the product names in our PDF documents from here on out have to link to their component files (these are also PDF files) on our server (which is currently hosted locally). This is a problem because any given document is generated as a Solidworks Assembly engineering drawings. 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 are any existing scripts out there that do something like the following:
    Find all instances in the text of product names beginning in 3 capital letters and ending in a number (digit)
    Create a hyperlink to the component parts files using the product name found in the text. Taking the product name--CAI623, for instance--and creating a hyperlink
    So the end result, for example, would be that a product name like CAI623 would become a hyperlink and would open the component part file like CAI623-1
    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. If not, I'll get to crackin' on making it myself.
    Thanks in advance for any pointers!

    I wrote a few similar scripts. If you're interested, give me your e-mail via PM.
    Kas

  • How to create hyperlink using form

    if a user click on button then
    oulook express open for sending mail but i want to create hyperlink on it automatically.
    actually when user click then a word file created on server i want to hyperlink this file the file name is my form serial_no

    when i click on button outlook express is opening know and i can send text on body through forms
    i need it to send hyperlink on outlook express so i can open document through this link which is on outlook express file

  • How to automatically create hyperlink destinations based on numbered list?

    I am very new to InDesign and am creating a template for an academic journal. Each article contains a list of references at the end and the references are cited in the main text (like what you see in Wikipedia if you are not familiar with scientfic journal articles). In exported HTML, the citation in the main text should be hyperlinked to the coressponding reference in the reference list. I have two questions:
    1) It is possible to ask paragraphy style to assign each numbered item a hyperlink destination? If this is possible, I can then manually inserted hyperlinks in the main text.
    2) one step further, is there any way (e.g. script) which can then insert hyperlink to those destinations based on pattern match? For example, in main text, the citation to reference #1 appear in the text as [1] which should be hyperlinked to reference #1.
    One more question, is there anyone who knows how academic journals handle the flow from InDesign to html? Certainly, the exported html cannot go directly online without further editing.
    Thank you.

    Hi Eric,
    I posted the script here. But it should be adjusted to your particular document. (Anyone with basic scripting knowledge can do this). I am sure it won’t work as it is. I assume that “comments” and “references” are in two different stories.
    Can I have the scripts from you (for a fee or free)?
    I don't sell my scripts: they're free.
    Can the scripts handle the pattens like these [3], [1-5], [3,4], [6, 8, 11-13]?
    This script can't, but another handles both single page numbers and page ranges like so:
    I can post it as well.
    Now I’d like to make one thing clear:
    I made a set of scripts for creating hyperlinks in InDesign documents for further exporting them to ePub/HTML. I can’t make a script that would work for everyone because all books are very different. I simply adjusted scripts for every book I had to work with (mainly changing GREP expressions and names of styles) and I have numerous variations of scripts. I can post them if someone is interested but you should be aware that they have to be reworked.

  • Enterprise Service: Find supplier using Product name or Product ID

    Hello,
                     I'm looking for an Enterprise Service to find suppliers who are selling a particular product by entering product name or ID as input...
                     I searched in ESworkplace and I could'nt find one, other than finding using supplier ID...
                     Does anyone have this service or know where I can find this Service please?

    Here you are. As you see, it's quite complicated -- InDesign needs a destination URL, a virtual hyperlink, and an instance of this virtual hyperlink. All in all it took me a couple of tries before I got it right. (It didn't help your example URLs don't exist yet )
    d = app.activeDocument;
    url_style = d.characterStyles.item("URL style name");
    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = "\\<AD\\w+[\\dx]\\>";
    sourceList = d.findGrep();
    for (l=0; l<sourceList.length; l++)
         link = d.hyperlinkURLDestinations.add ( "http://www.corpsite.com/"+sourceList[l].contents);
         d.hyperlinks.add ( d.hyperlinkTextSources.add (sourceList[l]), link ).name = sourceList[l].contents+" ("+l+")";
         sourceList[l].appliedCharacterStyle = url_style;

  • Playlist:  Creating playlist using folder names (auto)

    Is there a way to auto-create playlists using existing folder names? I have about 90-100 folders that I had created over the years; manually creating playlist for each folder would be a pain. I am looking for a way to auto create these playlists while iTunes is importing my folders (or otherwise). Any advice highly appreciated.
    Jixy

    iTunes alone has no way to do that. You will need a 3rd party folder watching program.
    Check out iTunes Folder Watch: http://albumbrowser.klarita.net/itfw.html

  • Automatically create a page with names of docs in folder

    I need to create a web page for our intranet that just
    dipslays all of the names of the docs in an "Archived" folder and
    provides a link to the docs in the folder. It's for archived
    reports that are needed on the intranet, but I want for my boss to
    be able to just save the previous day's report in a particular
    folder and have this "archived" web page automatically update every
    time a document is placed in the Archived folder. Is that possible?
    Will Dreamweaver produce a page like this automatically?

    Will
    > Dreamweaver produce a page like this automatically?
    >
    Nope.
    Is this intranet on a local web server?
    option one- set the controls for the web server to enable
    "directory
    browsing" That will display a simple ugly page with all the
    files in the
    folder linked.
    option two- what type of server side scripting can be used on
    this web
    server? Reply with that info and people may give links to
    possibles, or you
    could go to a place like
    http://hotscripts.com and search
    for a directory
    display script.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Creating Hyperlink using InDesign CS6 Server

    Hello,
    Could anyone help me to automate hyperlink generation for the web related contents, I can acheive this using desktop, but not in InDesign CS6 server, since 'selection' property is not supporting by the server version.
    Thanks,
    Praveen

    As i understand, if your panels at the same height you can create a new document with 6 page with the  size scaled to 25%, then on page panel: unckeck AllowDocumet Pages to Shuffle. Drag the pages to be side to side, and that make the total width of you mural
    When you export to pdf, on general tab check on all pages & spreads

  • Creating Hyperlink using POI Java API

    Hi
    I am using HSSF Cell and row for creation of my excel report. Now is it possible to create an external hyperlink to my data in the excel. If so can anyone tell me the process.
    Is it possi ble by any other process
    Regards
    Kalyan

    Ok, thanks for your quick answer. I saw you last blog posting regarding simple bar codes, I hope your next one turns up soon (read: today ;-) ).
    I did take a swing at writing my own class according to the user guide, using JDeveloper. One of my problems is that I am not that familiar with the whole java world, my experience lies almost entirely within .NET development. So when I read stuff like "make sure the class is available in the classpath for the JVM" and things like that, it is not a detailed enough description for me in order to make anything out of it. Do you think you can clarify that for me?
    I also wonder if you have any tips and tricks on how to trace/log information from the class when it executes? Because I think that I can actually get it to be called, it's just that something goes wrong and the generated PDF becomes badly formatted and has no content. I can see that some calls are made to a Logger class inside the example class. I guess that I need to set up some runtime configuration for that information to turn up in a file, but again me lacking experience from the java world prevents me from accomplishing that :-)
    Regarding tracing and logging from the java classes for the BI Publisher, can I get them to trace or log debug information in some clever way?
    The app I am developing is a .NET app that calls these classes using a product called juggerNET. I am developing a print direct application for JDEdwards EnterpriseOne since BI Publisher is not entirely integrated into it yet.
    I would greatly appreciate a quick reply this time as well if you can find the time!
    Best regards, Jörgen

  • Can't create hyperlinks after converting a Word document with Acrobat XI Pro

    Hello,
    Here's my problem.
    I'm making a catalog document for my company.
    The document that I'm converting to PDF is made on Office Word 2013 and it's a .docx format file.
    I'm on Windows 8 and the latest version of Adobe Acrobat XI Pro installed.
    Inside my word document I have some pictures that have a hyperlink. Those hyperlinks directionate to a bookmark inside the word document. Inside the word document, if I do Ctrl+Click over the image, it will go to the page that has that bookmark. And it works. Period.
    Beside that I also have some Cross-references on the word document. Those cross-references basically are the page number from the bookmark reference. By accident on most of those cross-refrences I left enabled the "Insert as hyperlink" on the cross-reference box options. When I Ctrl+Click over those cross-references I also go into the page of that cross-reference.
    After I convert the word document into pdf, I can't get any hyperlink on the pictures, if I simply click on them, like if I click on a hyperlink on a webpage or something similar, the pdf won't go the the bookmark on the page that I've set on the word document.
    The funny thing is that if I click on the other cross-references I can go to the page were that cross-reference is...
    I tried all the methods to convert the file in order to obtain hyperlinks on the images...
    I tried to use the Acrobat tab and the File -> Save as Adobe PDF, as both uses Acrobat PDFMaker, but nothing works.
    Even tried all options on Acrobat PDFMaker but can't get it. "Create bookmarks", "Add links", "Convert Word Bookmarks", "...Word Styles to Bookmarks", "...Word Headings to Bookmarks", none works....
    If I try to simply print from inside Word by choosing the Adobe PDF printer (like if I choose a regular printer), in the printers options it doesn't show up any hyperlink/link/bookmark option related, so that way is definitely a no go...
    To reference, on 2006/2007 I also worked on a similar project and used this method on the word document (on Word 2003). At that time I had another Adobe Acrobat version, can't remember what version was...
    This hyperlink situation was without any problem. After conversion, on the pdf file, if I click on a image it went to the right place inside that pdf file...
    So I'm simply lost wether it's a problem of me, a problem of Word, a problem from Acrobat... simply lost...
    I'm desperated....please, someone help me!!!

    Ok, sorry for never talk since the last time, but I finally discovered why I had this problem.
    I found out that M$ decided somehow to change the process of embedded hyperlinks on a image, but in a docx it doesn't get affected. Only after transforming it into a pdf by Acrobat that the problem emerges...
    I found this site http://www.pb-solv.net/2013/08/embed-pictures-in-microsoft-word.html
    Basically all I have to do is "Use Insert, Quick Parts, Field, IncludePicture. This inserts the picture in the old way as a field. You can use Alt-F9 to reveal the field codes and change the images to be embedded rather than linked."
    Then, after converting it with acrobat, the pdf finally have hyperlinks on the images!!!
    They change this on Word 2007. As I had the 2003, at the time, I didn't had this problem.
    As I said, M$ changed something, but only is affected after converting with acrobat. So, acrobat also missed something in the process. I call it a 50/50 guilt.
    To bad no one ever notice this problem...

  • Automate creating single PDF file from multiple documents

    Hi everyone ! I am testing the Adobe XI version, especially because I need it for a very specific function.I haven't found it yet, maybe you guys can help ?
    Basically, I need to make a user friendly system, that in one click will create a single PDF document from multiple files :
    To be more precise : I have in a folder on the network 25 different documents (Word and PDF mainly). Some of these documents change weekly. What I need as an end result is a single PDF, that combines these 25 ones in a specific order, and the tricky part is I need to automate this so that someone with absolutely no knowledge of Acrobat can perform this task, with just a click.
    I have found of course the procedure to manually build such a combined PDF, but as you can see it does not fulfil my needs.
    So that's it, as simple as that
    As a bonus question : I am still struggling with the construction of these documents : in the Word documents I use, there are both internal links within the document, and links between the documents (pointing to other Word files, or PDF files). I keep losing those links when I combine, is there something I am missing ?
    Second bonus question : I would like to have multiple levels of signets, but for some reason all my signets are at the same hierarchical level. Anything I am doing wrong ?
    A free electronic doughnut for anyone giving me a hint !

    When you combine you have many PDFs together in one, new PDF.  Your orignal links are from one specific file to another specific file. A combine does not change the link in the original file. So the link is now from the  PDFcombined  to the second specific file. However, "second specific file" won't be present - so, "broken link".
    Be well...

  • Automatic Stock replinshment using production order

    Dear Experts
    Our client wants to trigger Production order for material automatically once stock reaches below reordering point.
    MRP TYPE : V1
    Lot Size: FX { Reordering point 200 Fixed lot size 600}
    My understanding is only MRP run creates Planned order and using PPBICO40 Production can be triggered automatically.
    Clarification need on : Whether production order can be created once material stock reaches below reodering point regardless of Sale order or MRP run.
    Please guide me
    narayanan

    hi,
    Your perception is right, It is not possible to create the production order directly with MRP.
    Regards
    Shekhar

  • Automatically creating database using core java by runnin an application

    hi evryone...
    My question is how to create a database automatically usin core java by runnin an application i mean to say tat Is it possible to create a DSN
    where we can directly create a database when we run a java application... plz... help me by solving dis query...
    Thank 'U'

    Your requirements are vague, but it sounds like you want an embedded database. Here are two:
    http://db.apache.org/derby/derby_downloads.html
    http://hsqldb.org/
    You can't create a database directly using "core" java, unless you equal serializing with real dbs.
    Edited by: Brynjar on Jan 26, 2008 4:49 AM

  • HT4650 how do you get rid of adware in safari that creates hyperlinks to product websites?

    I use thepiratebay.se and utorrent and I'm afraid somehow I've let adware screw up my safari broswer. I have a website www.lucidocopper.com and I have noticed several words are now hyperlinked to 3rd party's product websites. Now I'm afraid it's affecting the uploading of pictures to my website. I have not downloaded anything and I'm not sure what to do. I'd deleted all unknowns from application folder and all wondershare files from my finder. Are there any anti adware or anti virus software for mac to install to protect me in the future and ferret out the issue?
    Cheers!

    From the Safari menu bar, select
    Safari ▹ Preferences ▹ Extensions
    If any extensions are installed, disable them and test.

  • Using file names as picture text in iMovies

    I have been using IDVD and it allows you to use the filename as the title of the picture in the slideshow. It is convienant since i dont have to relabel my pictures. So if the file name of the picture is mummy with auntie Kay, then that will appear as the title of my picture. Does Imovies have a similar feature? or do i have to painstakingly relabel all my pictures?

    There is no similar feature in imOvie that I know of.

Maybe you are looking for

  • Ipod shuffle (2nd gen.) not recognized by my powerbook (g4)

    My new iPod shuffle (2nd gen.) not recognized by my powerbook (g4). Get error message "The disk you inserted was not readable by this computer". It works just fine with my iMac (g4). If iTunes is open the shuffle is just not recognized. Have tried my

  • Fix for BT headset nightmare in VMWare Fusion? (Macbook Leopard)

    Appreciate any help after struggling for over a day trying to connect a top Bluetooth headset (Jawbone)... Thanks, Mark Openworld.com CASE: 2 GB Ram Macbook Leopard OS Fusion 1.0 running WinXP Service Pack 2 Jawbone Bluetooth Headset Bluetooth headse

  • Calling a JSP  from abstract portal component

    hi, I have included a JSP in a abstract portal component and on click of submit in 1st JSP i have to show an another JSP.How can i do this??? Regards Sushanth

  • Getting error while Installation of EP

    Hi All, I have Installed ABAP Trail Version on D drive of my PC and now when i am trying to install EP on any other drive then it is giving error : ERROR 2009-11-25 04:08:56 FSL-02107 Path component contains reserved character ('"'): "D: ERROR 2009-1

  • FF and Safari position fix

    This was the last post in a thread earlier today. When no vertical scrollbar is required centered a web page will jump about 5px to the right compared to the position when scrollbar is present. I'm reposting it because I wanted everyone to have a cha