0 Replies Latest reply on Aug 25, 2008 8:59 AM by MarkPeterson01

    Hyperlink Page Destination (CS3 (5.0.3) JavaScript)

    MarkPeterson01
      I'm trying to write script that will add a new hyperlink destination for page 2 of a document. The following scripts will add a new hyperlink destination for page 1, but not page 2. What am I doing wrong?

      Thanks,
      Mark

      Script #1

      var myPage = app.activeDocument.pages.item(1);
      var myDest = HyperlinkPageDestination.destinationPage = myPage;
      //add the new hyperlink destination
      var myHyperlink = app.activeDocument.hyperlinkPageDestinations.add();
      myHyperlink.name = "test 1";
      ---------------------------------------

      Script #1

      //Use a text selection to choose page
      var mySel = app.selection[0];
      var myDest = HyperlinkPageDestination.destinationPage = mySel.parent;
      //add the new hyperlink destination
      var myHyperlink = app.activeDocument.hyperlinkPageDestinations.add();
      //Name the new destination.
      myHyperlink.name = "test 1";