Hi all, I need help, a little new to inDesign scripting. I have created a script that adds 6 - 7 hyperlinked rectangles per pages in a document that can vary from 5 - 250 pages, using loops. Everything works fine apart from the hyperlinks, all the hyperlinks go to the same page because the rectangle object is always called myButt. I have tried using the id to add the hyperlink but this is not compatible with "hyperlinkPageItemSources", I would like to create a variable name for myButt, but can't figure it out. This is the code creating the rectangle: var myButt = myDoc.pages.rectangles.add({ geometricBounds: [y1 , x1, y2, x2], topLeftCornerOption: CornerOptions.ROUNDED_CORNER, topLeftCornerRadius: "6px", bottomLeftCornerOption: CornerOptions.ROUNDED_CORNER, bottomLeftCornerRadius: "6px", topRightCornerOption: CornerOptions.ROUNDED_CORNER, topRightCornerRadius: "6px", bottomRightCornerOption: CornerOptions.ROUNDED_CORNER, bottomRightCornerRadius: "6px", }); This is the code to add the hyperlink: var myHyperPage = myDoc.hyperlinkPageDestinations.add(myDoc.pages.item(Hlink)); var myHyperSource = myDoc.hyperlinkPageItemSources.add(myButt); var myHyper = myDoc.hyperlinks.add(myHyperSource,myHyperPage); myHyper.visible=false; Please help, thanks in advance.
... View more