Hi
I am new in indesign scripting.
I want to create CrossReference, which is link to Paragraphs (or Text Anchor) of another indesign file ( new.indd ).
My first problem is how get All Paragraphs or Text Anchor of new.indd file
I have a TextFrame whose content is Adobe Indesign.
I want to apply a CrossReference on Adobe Indesign link to Paragraphs with Destination Documents : new.indd.
How it is done by script ?
I am try using this :
#target indesign
var myDocument = app.documents.add();
var myTextFrame = myDocument.pages.item(0).textFrames.add();
myTextFrame.geometricBounds = ["10p", "15p", "30p", "35p"];
myTextFrame.contents = "Adobe Indesign";
var text =myTextFrame.texts.firstItem();
var hyperlinkURLDestination =myDocument.hyperlinkURLDestinations.add("C/Documents and Settings/Administrator/Desktop/new.indd");
///////////var DestinationDoc=hyperlinkURLDestination.parent();
var xRefForm = myDocument.crossReferenceFormats.item("Page Number");
var source = myDocument.crossReferenceSources.add(text, xRefForm);
var myLink =myDocument.hyperlinks.add(source, hyperlinkURLDestination);
When I run this script it give error "The destination is invalid. You can only create Cross- Reference to a Text Anchor or paragraph destination".
How I get All Paragrapgs or Text Anchor of new.indd file and create Cross-Reference using this.
Thanks.