Hello @SophiaPP,
Re: Is there a way to generate a list of all hyperlinks and their destination pages?
The below script is a play off of @Manan Joshi script from the link below.
https://community.adobe.com/t5/indesign-discussions/script-to-extract-hyperlinks-from-indesign-file-with-page-number/m-p/10919365
Give this script a try as I think this what you're after..
var list = [];
for (a=0; a<app.activeDocument.hyperlinks.length; a++){
try{
d = app.activeDocument.hyperlinks[a].destination.destinationPage;
var b = app.activeDocument.hyperlinks[a].source;
var x = app.activeDocument.hyperlinks[a].name;
var page
if(b.constructor.name == "HyperlinkPageItemSource")
page = b.sourcePageItem.parentPage.name
else if(b.constructor.name == "HyperlinkTextSource")
page = b.sourceText.parentTextFrames[0].parentPage.name
list.push ("Hyperlink: " + x + " " + "Destination Page:" + d.name);
} catch(_) {}
}
// show the list
alert ('All links:\r'+list.join('\r'));
// save the list as a file
listFile = new File(Folder.myDocuments+"/all_links.txt");
if (listFile.open("w"))
{
listFile.write(list.join('\n'));
listFile.close();
listFile.execute();
}
Regards,
Mike