Answered
Script to change HyperlinkPageDestination ViewSetting
Hi.
I am trying to speed up my process of creating page links. As InDesign does not allow the default of 'Fixed' to be changed, I would like to create a script to run through the document and change the setting of all HyperlinkPageDestination ViewSetting.
The code I am trying to change is underlined below:
</Properties>
</HyperlinkPageDestination>
<HyperlinkPageDestination Self="HyperlinkPageDestination/.122286" Name=".122286" NameManually="true" DestinationPage="n" ViewSetting="FitWidth" ViewPercentage="105" Hidden="true" DestinationUniqueKey="106">
The script I have tried to chop together (amongst others) is:
var doc = app.activeDocument;
for(var i = 0; i < doc.HyperlinkPageDestination.length; i++) {
try {
doc.HyperlinkPageDestination.item(i).ViewSetting = doc.HyperlinkPageDestination.item(i).ViewSetting.replace("Fixed", "FitWindow");
} catch(e){}
};
This generates an 'Error Number: 55'. Does not support the property or method 'HyperlinkPageDestination'. The source is:
for(var i = 0; i < doc.HyperlinkPageDestination.length; i++) {
If anyone can help, I would really appreciate it.
Thanks in advance.