INDESIGN: Hyperlinks Question
INDESIGN: Hyperlinks Question
- Subject: INDESIGN: Hyperlinks Question
- From: Rick Gordon <email@hidden>
- Date: Mon, 1 Dec 2008 16:33:43 -0800
I noticed in an InDesign CS3 document containing a generated table of contents, that in addition to the 3 hyperlink URL references in the document, which show up in the Hyperlinks panel, the script returns an additional hyperlink for each TOC entry. The class of the destination of those hyperlinks is hyperlink external page destination.
So I wanted to write a script that would allow me to differentiate between those two types. First doing a relity check, I set up the following script:
tell application "Adobe InDesign CS3"
tell active document
set vDestList to destination of hyperlinks
set vURLs to {}
repeat with vItem in vDestList
tell vItem
if class is hyperlink URL destination then
set end of vURLs to class
end if
end tell
end repeat
return vURLs
end tell
end tell
It did what I expected, and produced a list of three class references. However, if I changed the portion within the repeat loop to the following:
tell vItem
if class is hyperlink URL destination then
set end of vURLs to it
end if
end tell
... then the list contains references to all 50-something hyperlinks, not just the three that are URL references. Changing the "it" to an explicit reference does not change things, nor does making the condition into:
if class is hyperlink URL destination and class is not hyperlink external page destination
Why? And why are the TOC hyperlinks, if they are considered as such, not showing up in the Hyperlinks panel?
(Now if I were in Nevada, and could bet on who probably has the answer, I might be able to come out ahead here.)
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW: http://www.shelterpub.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden