2 Replies Latest reply on Oct 11, 2011 11:12 AM by Michael Müller-Hillebrand

    Automating hyperlink creation

    mugg326 Level 1

      Hi all,

      I'm a Frame AND scripting noob. I'm migrating several long docs from Word to Frame 10. I'd like to figure out how to automagically ID and add hyperlinks to URLs written in plain text after conversion. This sounds like a job for ExtendScript.

       

      My mental model looks like this:

      1. Wildcard search for "www.*" or similar;

      2. Copy url text;

      3. Open HYPERTEXT toolbar in Frame UI;

      4. Set 'Command:' to 'Go to URL';

      5. Paste 'http://' and copied URL text into box;

       

      Pretty simple non paper, but is this feasible using JScript or EScript? Thanks in advance!

        • 1. Re: Automating hyperlink creation
          frameexpert Level 4

          Hi,

           

          Yes, you can do this with ExtendScript. One thing to keep in mind though; if your output is PDF, Acrobat can automatically convert URLs to links in the resulting PDF file. But, you can certainly do it in FrameMaker with ExtendScript (or FrameScript, if you have it).

           

          Rick

          1 person found this helpful
          • 2. Re: Automating hyperlink creation
            Michael Müller-Hillebrand Level 4

            Mugg,

             

            You have to change your mental model from being too close to the UI. It would work like this:

             

            1. Wildcard search for "www.*" or similar; or: use the current selection

            2. Copy url text; no need to use the clipboard, just store it in a variable

            3. insert a marker of type "Hypertext" at the start of the text range

            4. set marker text to "message URL http://" + stored website.

            5. apply a  character format to the text range from marker until end of found/selected text.

             

            The last step limits the "hot" area to that range.

             

            Now, go ahead!

             

            - Michael

            1 person found this helpful