Copy link to clipboard
Copied
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:
Try the following
var doc = app.activeDocument;
for(var i = 0; i < doc.hyperlinkPageDestinations.length; i++) {
try {
doc.hyperlinkPageDestinations[i].viewSetting = HyperlinkDestinationPageSetting.FIT_WINDOW
} catch(e){}
};
-Manan
Copy link to clipboard
Copied
Try the following
var doc = app.activeDocument;
for(var i = 0; i < doc.hyperlinkPageDestinations.length; i++) {
try {
doc.hyperlinkPageDestinations[i].viewSetting = HyperlinkDestinationPageSetting.FIT_WINDOW
} catch(e){}
};
-Manan
Copy link to clipboard
Copied
Many thanks for the reply.
The script runs without error, but does not change the ViewSetting.
Copy link to clipboard
Copied
Try it again, I edited the code after I posted the first time. The viewSettings had a typo, the v should be lowercase. No errors are shown because of the try-catch block
-Manan
Copy link to clipboard
Copied
Genius! Works perfectly.
Thank you so much!