TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Subject:Re: Still need help with InDesign hyperlinks From:"Edgar D' Souza" <edgar -dot- b -dot- dsouza -at- gmail -dot- com> To:"siliconwriter -at- comcast -dot- net" <siliconwriter -at- comcast -dot- net> Date:Fri, 22 Sep 2006 13:43:41 +0530
Sarah,
It *may* be possible to work around this annoyance using scripting, but I
regret I don't have InDesign installed on my system, so can't try out the
other side of this approach. I would personally rather invest a couple of
days to *learn* how to work with scripting rather than do hundreds or
thousands of hyperlinks all over again, by hand :-/ - after Doxygen produced
them automatically! And to have to do them all over again for the next
version of the software... [shudder]
Overview:
1. Import the RTF into a Word doc.
2. Use a Word macro to extract the URL of the hyperlink and dump it as text,
right beside the hyperlink itself.
3. Write an InDesign VBScript script which searches through your
imported-from-Word document for these extracted URLs, then cuts them out of
the text, selects the word or words before the URL, and creates a Hyperlink
out of that, using the URL text which was just cut to the clipboard.
The Word side of it is pretty simple; you could use a small macro like this
on, which I threw together in a couple of minutes:
Sub ExtractHLinks()
Dim hlLoop As Hyperlink
Dim strTemp As String
For Each hlLoop In ActiveDocument.Hyperlinks
strTemp = hlLoop.Address
hlLoop.Range.Select
Selection.Collapse WdCollapseDirection.wdCollapseEnd
Selection.TypeText " ( " & strTemp & " )"
Next
End Sub
The above, given text like this ("Google" and "Yahoo" are actually
hyperlinks to the respective sites, not evident in my text-only mail):
This is filler text. Hyperlink to Google. More filler text. Hyperlink to
Yahoo. And some filler text to cap it off.
InDesign also has a VBScript engine, but as I said, I don't have a copy - so
I can't research the receiving end, where you automate the conversion back
into a Hyperlink object. In fact, I don't know if it's possible or if Adobe
have blocked that hole as well - but given that they seem to have a Bookmark
object and some HyperlinkDestination object (among others), I would hazard a
guess that it's doable.
Maybe you or some kind person on this list could look at the Scripting
Reference PDF on the IDCS2 CD-ROM, and try out (perhaps just on the sample
text above), whether you can :
1. Search for text starting with "http://" (assuming ALL your URLs start
with that) and ending with a space
2. Select the "found" text.
3. Cut it to clipboard or assign it to a string variable and delete the URL
text.
4. Collapse the selection backward, then select a word to the left.
5. Make whatever call is necessary to convert the selected text to a
hyperlink, using the copied URL text as the destination.
I'm sorry I've used Word-relevant concepts of a selection, collapsing it
etc., but I have no idea of what it's like under IDCS2's scripting hood.
Sorry.
Regards,
Ed.
On 9/22/06, siliconwriter -at- comcast -dot- net <siliconwriter -at- comcast -dot- net> wrote:
On another thread, I've been hashing out a problem I'm having importing
RTF files with hyperlinks into InDesign. My RTF is generated by Doxygen
directly from code, and includes hundreds of hyperlinks. I need to retain
those hyperlinks when importing/placing into InDesign CS 2. Unfortunately,
if I import the RTF directly, I get gobbledegook like
When I import the RTF into Word, the hyperlinks work fine. I then save the
Word file BACK to an RTF file, and when I import either the Word file or the
Word-to-RTF file, everything *looks* just fine. Except that the hyperlinks
have all lost their links. The text is still formatting correctly: blue font
with a single underline. But there are no hyplerlinks attached to that text.
It's very difficult and "unintuitive" to add hyperlinks to an InDesign
document; adding several hundred is a daunting task. I'm afraid there will
be many errors creeping in. Before I start manually adding all these
hyperlinks back, I would like to know if any expert InDesign users here have
confronted this problem and solved it.
The Adobe user forums do not appear to address this issue at all.
WebWorks ePublisher Pro for Word features support for every major Help
format plus PDF, HTML and more. Flexible, precise, and efficient content
delivery. Try it today! http://www.webworks.com/techwr-l
Easily create HTML or Microsoft Word content and convert to any popular Help file format or printed documentation. Learn more at http://www.DocToHelp.com/TechwrlList