Re: Still need help with InDesign hyperlinks

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.

changes it to:

This is filler text. Hyperlink to Google ( http://www.google.com/ ). More
filler text. Hyperlink to Yahoo ( http://www.yahoo.com/ ). 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

RTFDocVisitor::visit(DocWhiteSpace)
RTFDocVisitor::visit(DocWord)inRTFDocVisitor::visit(DocWhiteSpace)

640 pages of it, to be precise.

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

---
You are currently subscribed to TECHWR-L as archive -at- infoinfocus -dot- com -dot-
To unsubscribe send a blank email to techwr-l-unsubscribe -at- lists -dot- techwr-l -dot- com
or visit http://lists.techwr-l.com/mailman/options/techwr-l/archive%40infoinfocus.com


To subscribe, send a blank email to techwr-l-join -at- lists -dot- techwr-l -dot- com

Send administrative questions to lisa -at- techwr-l -dot- com -dot- Visit
http://www.techwr-l.com/techwhirl/ for more resources and info.


Follow-Ups:

References:
Still need help with InDesign hyperlinks: From: siliconwriter

Previous by Author: Re: Modular documentation
Next by Author: Re: Still need help with InDesign hyperlinks
Previous by Thread: Still need help with InDesign hyperlinks
Next by Thread: Re: Still need help with InDesign hyperlinks


What this post helpful? Share it with friends and colleagues:


Sponsored Ads