Help Creating Cross-References Linked to Text Anchors
Hi I'm fairly new to scripting so I'm having trouble modifying the following script. I've gotten it to do all I need to do except that I need to change the link type from URL to Text Anchor. Can you please help?
var myDoc = app.activeDocument;
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "a";
app.findGrepPreferences.appliedCharacterStyle = myDoc.characterStyles.item("Superscript");
app.findGrepPreferences.appliedParagraphStyle = myDoc.paragraphStyleGroups.item("Table").paragraphStyles.item("Table Title");
var myFound1 = myDoc.findGrep();
count = 0
for(k=0; k<myFound1.length; k++)
{
try{
var myFind = myFound1
; var myHyperlinkSource = app.activeDocument.hyperlinkTextSources.add(myFound1
) var myHyperlinkURLDestination = app.activeDocument.hyperlinkURLDestinations.add(myFound1
.contents) var myHyperlink = app.activeDocument.hyperlinks.add(myHyperlinkSource, myHyperlinkURLDestination, {name: myFound1
.contents+count++}) count++
}catch(e){}
}
alert(count/2 + " Ocurrences is changed")