🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #8109

[AS]{ID2.02} Is hyperlink page destination always necessary?

#8109
From: Eric_McManus
Date: Fri, 10 Nov 2006 18:54
30 lines
2187 bytes
In the interface, you can create a new hyperlink, choose the type 'Page' and specify the page to which you want the link to go. You don't need to mke the destination first.

In a script, it seems like you need to use the hyperlink page destination command to create the destination before you can direct to a page. Is there a way to skip this step?

This works:

tell application "InDesign 2.0.2"
	set myDocument to active document
	set myStory to parent of selection
	set myPage to page 200 of myDocument
	tell myDocument
		set myHyperlinkTextSource to make hyperlink text source with properties {source text:paragraph 13 of myStory}
		set myHyperlinkPageDestination to make hyperlink page destination with properties {destination page:myPage, name:"page 200"}
		set myHyperlink to make hyperlink with properties {destination:myHyperlinkPageDestination, source:myHyperlinkTextSource, name:"Go to page 200"}
	end tell
end tell

This gets an Invalid Parameter error:

tell application "InDesign 2.0.2"
	set myDocument to active document
	set myStory to parent of selection
	set myPage to page 200 of myDocument
	tell myDocument
		set myHyperlinkTextSource to make hyperlink text source with properties {source text:paragraph 13 of myStory}
		set myHyperlink to make hyperlink with properties {destination:myPage, source:myHyperlinkTextSource, name:"Go to page 200"}
	end tell
end tell

Oh, and sorry I'm using the double-plus old version. I'll convince the boss to upgrade eventually.
Technical Details
Message-ID: <3bc23e1e.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!news.isoc.lu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,b528b8dd777fc022
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Eric_McManus@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!news.isoc.lu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: [AS]{ID2.02} Is hyperlink page destination always necessary?
Message-ID: <3bc23e1e.-1@webcrossing.la2eafNXanI>
Date: Fri, 10 Nov 2006 10:54:47 -0800
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit