[JS][CS6] Change hyperlink page destination

Hi people!
I bet this is simple, but I can't work it out.. and documentation is scarce.
I want to change the PageDestination of a certain hyperlink via javascript.
Lets go with this:
app.activeDocument.hyperlinks.itemByName("Hyperlänk 8").destinationPage = 1 (or something else)
...the above doesn't work. What should I use instead of ".destinationPage"?
Thanks

PrntScr wrote:
What should I use instead of ".destinationPage"?
A page, not a number. A number could mean anything, whereas a page is .. a page
But this
app.activeDocument.hyperlinks.itemByName("Hyperlink 1").destinationPage = app.activeDocument.pages[0];
does not work, because you forgot a level. A hyperlink has a destination, not a destination page, because hyperlinks can point to various items -- see http://jongware.mit.edu/idcs5/pc_Hyperlink.html.
So, use this
app.activeDocument.hyperlinks.itemByName("Hyperlink 1").destination.destinationPage = app.activeDocument.pages[0];
and it will work, but only if the destination type already is a "HyperlinkPageDestination". If it's not, you have to add it first to your document's list of hyperlinkPageDestinations -- which is returned as a new object -- and then assign this object to the 'destination' property.

Similar Messages

  • Change page destination of a button

    I have a book of 54 documents. I 've made in each document some buttons to go to another document (hyperlink). No I have to make this same book in another language. I copied my document, renamed them by changing a suffix (for ex: _be into _fr)
    I am wondering if it is possible to change the page destination of a button with a script...  I hope that it's possible because it is a lot of work to relink all this buttons.
    Is there someone who can help me with this?

    here is an example using a little css witha button with an id of #test
    CSS:
    #test{
        color:#FFF;
        border:thin solid #003;
        background-color:#900;
    HTML:
      <input type="button" name="test" id="test" value="Submit" />

  • Anyone managed to change default hyperlink colour or to globally change hyperlink colour in Pages????

    Anyone managed to change default hyperlink colour or to globally change hyperlink colour in Pages????
    - Thats all I  want to do, the holy grail of desktop publishing, being able to choose a colour and apply it everywhere, c'mon Apple sort it out, its surely not rocket surgery....

    I figured it out.
    Select one instance of the hyperlink, and define it as a character style in the styles drawer.
    Then create the preferred style you want to use for hyperlinks and save it to character styles.
    You can select every instance of the original link style, and replace with the preferred style.
    Hopefully I've explained this adequately.
    Cheers.

  • How to change hyperlink destinations

    Hi, I would like to have a different setting for the
    hyperlink destination for two layouts. For one layout I want the
    links to open in a new window; for the other layout I want the
    links to open in the same window. Is there a way I can change the
    link destinations for the entire project; or is the only option
    change each link individually? Thanks, Becky

    From what I can work out you have two options - well three if
    you include amending the links individually. My favoured method
    would be to have two links and use build tags for each one and
    assign these to your layouts. The other method would be use a find
    and replace tool (e.g.
    FAR. You can go into the
    truecode to see the syntax required to be found and replaced. But
    before you do anything with a find and replace tool, take a backup
    of your project.

  • How To Change Hyperlinks And Nav Menu Colors

    I continue to see people stating that it's impossible to change hyperlink colors and navigation menu colors until after you publish your site. This is not true. It's quite easy to update your templates with the colors YOU want and when you update the template, you never have to mess with any post-processing. You make a new page? Your colors are already there.
    I've gone over this before in this thread:
    http://discussions.apple.com/thread.jspa?messageID=3288533&#3288533
    But I'll go over the quick and dirty version here as well. Those who want more detail can post a question and I'll elaborate.
    First, do you know how to get into iWeb's inner folders? You right click or control click on your iWeb icon and select Show Package Contents from the pop-up menu.
    Step 2
    Once you've done that, you'll see a new Finder window that shows a folder called Contents. Open that and then open the next folder Resources. Within Resources there's a folder named Shared. Open the Shared folder.
    You're now looking at your collection of iWeb template files. You'll notice that each template has seven individual page files - each file defines the layout and styles for the page for which its named. This is actually one of the two places where you'll find the data/images that make up your iWeb pages. This location only contains the images. Now I'll show you were to find the data file.
    So you're currently here:
    /Applications/iWeb/Contents/Resources/Shared/
    You want to go here:
    /Applications/iWeb/Contents/Resources/English.lproj
    Now if you speak another language and your Mac's system language is set to the language you speak, substitue English with that language. If your system is set to English regardless of the language you speak, and you use the English templates, then stick with the English folder.
    When you're in the English.lproj folder, you will see seven sub-folders and one file named TemplatesInfo.plist. TemplatesInfo.plist is the file that registers the templates and tells iWeb what you've got in your collection. But we don't care about that file for now. We're after the template data files.
    The seven sub-folders are aptly named for each of the seven page-types as you can see. Open the About Me folder.
    Now you will see an "about me.webtemplate" file for every template you have in your collection. Good job. You've learned something new. Move on to Step 3.
    Step 3
    If you haven't decided yet, now's the time to decide which template you'd like to update. If you're just along for the ride to learn something new, no worries. We won't do anything you can't undo.
    Pick a template file now. Perhaps you chose the White template, or:
    White About Me.webtemplate
    Right click or control click on this file and select Show Package Contents from the pop-up menu. This will launch a new Finder window that displays the contents of the White About Me.webtemplate file.
    You will likely see a handful of different files, but the file you want is the one named Index.xml.gz.
    Index.xml.gz is the brain behind the template. Within this file are all the settings for the page you chose and it's really not hard to find what you want and change it. So let's take a peek.
    Step 4
    Double-click the file Index.xml.gz. This will reveal a new file named Index.xml. You might have to scroll down in your Finder window to see it. Rename Index.xml.gz to Index.xml.gz.backup in case you screw things up, you have your original.
    Now, open Index.xml with TextEdit. Do not open the file with a code editor unless you have already formatted the file.
    When the file opens, you'll notice it's one gigantic jumbled mess of stuff. No worries, we'll straighten that out. All you need to do is a find/replace.
    Find all instances of: ><
    And replace with:
    <
    The line break is important so maybe just copy the lines right out of this post. When you replace all of those, the file will be far more easy to view.
    Assuming you've completed that step. You're basically ready to make your change and test it out! Not hard ey?
    So let's say you want to change your hyperlink color from grey to blue. Search for this string:
    BLDefaultHyperlinkCharacterStyleIdentifier0
    When you find that string, you will see a few lines below it, two lines that look similar to this:
    <sf:fontColor>
    <sf:color xsi:type="sfa:calibrated-rgb-color-type" sfa:r=".8" sfa:g="1" sfa:b="0.4" sfa:a="1"/>
    This is how the template specifies color. It's RGB100. Your Mac came with a program called Art Director's Took Kit and that application can tell you the RGB100 values for any color you want. Tinker with that and you'll have a lot of fun with this.
    So I picked out a nice royal blue for you. The RGB100 values for it are:
    R:0 G:25 B:100
    What you need to do is update the color line to match those values:
    <sf:color xsi:type="sfa:calibrated-rgb-color-type" sfa:r="0" sfa:g=".25" sfa:b="1" sfa:a="1"/>
    Notice that you specify these in terms of a percentage, where 25 became .25 and 100 became 1.
    Step 5
    Save your file. It's time to see your work in action. Open iWeb if it isn't open already and create a new page using the template you've just altered. If you altered the White About Me page, then select that and create the new page.
    It there are hyperlinks already on this page, you should already see that they reflect your new color. If there aren't any hyperlinks, then type some text and create one. You should see your new link color right away!
    Now if you don't see the new color, either you picked the wrong page or you neglected to rename the Index.xml.gz file a few steps back. If you did not rename that file, then it's still in control of your template. Rename it now and try again.
    If you don't like that color, simply swap back to the TextEdit page and change it until you like it - switching back and forth between the file and iWeb to view your changes. Once you're happy, make note of the color you chose and make the change for the remaining six pages in the tempalte you selected. Just be sure to follow the steps for each page you edit. If you fail to see your change, again, check to see that you renamed Index.xml.gz.
    Side Notes
    For the more technical, rather than editing an existing template, you might want to duplicate and rename a template. This essentially creates a brand new one. If you're pretty good within Finder then go for it, just be sure that you duplicate the files in both locations:
    /Applications/iWeb/Contents/Resources/Shared/
    /Applications/iWeb/Contents/Resources/English.lproj/...
    Choose a unique name for the duplicated template and change every single file so that the new name replaces the old one. You would have to register this new template in the TemplatesInfo.plist file as well, but I'm not going to get into that here.
    The thread I referenced at the top has all kinds of search terms to find the other hyperlink styles (rollover and visited) and all the navigation menu styles plus a bunch of other fun stuff.
    Now, it seems long, but that's because I wrote it well. The shortest version of this I've ever written was two sentences, but that was for a UNIX geek and he got it. It's just as easy for you, but I write it out so that anyone can do this, because anyone can. It's just not hard.
    If you have questions about any of the steps, go ahead and ask.

    Good. Okay here's how to apply a background color to your nav bar buttons. For example, my Aerolite template sets the selected page to a black background color. The rollover effect uses a gradient fill. I'll describe both of those here.
    First, here are the navigation menu search terms:
    navbaritem-style-normal-default
    navbaritem-style-rollover-default
    navbaritem-style-selected-default
    navbar-pargraph
    The first three set the button effects and text colors. The last one there sets the font, font size and other paragraph styles.
    To change the selected page button background color, or gradient or image, first search for it using the search term above. Start from the top of the file because there are two instances of those terms, one where you can set the values, the other is only reference to the first and does not allow you to change settings.
    When you find the search term, you might want to insert an empty line above it to help separate it from the rest of the code. You can also insert an empty line below the section. The end of this style ends with:
    </sf:navbar-item-style>
    Be careful not to mix that up with </sf:navbaritem-character-style>
    Now, within this section, you'll find all kinds of settings... stroke, fill, character styles, etc. Notice you can change font color in there. But for this demo, you want to find the section that looks like this:
    <sf:fill>
    <sf:null/>
    </sf:fill>
    I'm assuming you're editing an Apple template that does not already have a fill effect. If it does have one, then your example might not look exactly like that.
    To apply a color fill, change those three lines to these lines:
    <sf:fill>
    <sf:color xsi:type="sfa:calibrated-rgb-color-type" sfa:r="0" sfa:g="0" sfa:b="0" sfa:a="1"/>
    </sf:fill>
    You can see that we've inserted the line that specifies color - something you should be familiar with by now. Here you can specify the color that will become the background of your nav bar button. This example specifies black. Easy no?
    If you would prefer a gradient fill, then replace those three lines with this:
    <sf:fill>
    <sf:angle-gradient sfa:ID="SFRAngleGradient-1111" sf:opacity="1" sf:type="linear" sf:angle="0">
    <sf:stops sfa:ID="NSMutableArray-1111">
    <sf:gradient-stop sfa:ID="SFRGradientStop-1111" sf:fraction="0">
    <sf:color xsi:type="sfa:calibrated-rgb-color-type" sfa:r="0.40" sfa:g="0.40" sfa:b="0.30" sfa:a="1"/>
    </sf:gradient-stop>
    <sf:gradient-stop sfa:ID="SFRGradientStop-2222" sf:fraction="1">
    <sf:color xsi:type="sfa:calibrated-rgb-color-type" sfa:r="0.64" sfa:g="0.66" sfa:b="0.54" sfa:a="1"/>
    </sf:gradient-stop>
    </sf:stops>
    </sf:angle-gradient>
    </sf:fill>
    Now, don't panic Here's what this is. The first line allows you to specify the angle of your gradient. Play with the numbers from 0 to 359 until you have what makes sense for your design.
    Then, you will see two familiar lines again - the lines that allow you to specify color! The first line is the first color of your gradient and the second color is the second color of your gradient. That's all there is to it!
    SECRET: It might be possible to add additional colors, not just two. Do you see the part sf:fraction="0" and sf:fraction="1"? These are gradient stops. I'm willing to bet that if you inserted a thrid gradient stop with a fraction setting of .5, you'd have a three-color gradient!
    <sf:gradient-stop sfa:ID="SFRGradientStop-3333" sf:fraction=".5">
    <sf:color xsi:type="sfa:calibrated-rgb-color-type" sfa:r="0" sfa:g="0.25" sfa:b="4" sfa:a="1"/>
    </sf:gradient-stop>
    I have never tried this - it just occurred to me as I was looking at this code. Big prize for the first person to prove the theory
    NOTE: You will notice that the number 1111 and 2222 are within this code. iWeb XML relies on identification tags here and there. It's nothing you really have to care about except if you insert gradient fills in more than one area. Those numbers need to be unique so if you paste that code in for your selected page button and then paste it again for your rollover buttons, you'll need to update the numbers for the second button. Any numbers are fine. Use 3333 and 4444 for the second set, 5555 and 6666 for the thrid and so on. I often just type 4345781476 - doesn't matter.
    Next lesson will be images.

  • [JS, CS3]  Setting Page Destination on Button

    Hi
    I unsuccessfull try to set the a Page Destination on a Button.
    The script loops through the Document and picks certain textframes, which contain the page.name as text. inside the loop I do this:
    // START LOOP
    // Getting the Content of Textframe -> this is the destination Page Number
    myDestinationPage = myDocument.pages.itemByName ( myDocument.pages[ pageIterator ].textFrames[ textFrameIterator ].contents );
    // Creating a HyperlinkPageDestinationObject
    myHyperlinkPageDestination = myDocument.hyperlinkPageDestinations.add( myDestinationPage );
    // Creating a new Button over a certain area on the actual Page - setting visibility off
    myButton = myDocument.pages[ pageIterator ].buttons.add({visibilityInPdf:1181247844, geometricBounds:[ myDocument.pages[ pageIterator ].textFrames[ textFrameIterator ].geometricBounds[ 0 ],12,myDocument.pages[ pageIterator ].textFrames[ textFrameIterator ].geometricBounds[ 2 ], myDocument.pages[ pageIterator ].textFrames[ textFrameIterator ].geometricBounds[ 3 ]]});
    // Creating an hyperlinkPageItemSource = the Actual Button myHyperlinkPageItemSource = myDocument.hyperlinkPageItemSources.add( myButton );
    // Creating an Hyperlink
    myHyperlink = myDocument.hyperlinks.add( myHyperlinkPageItemSource, myHyperlinkPageDestination );
    //The Destination shall be a Ceratin Page so I add a gotoAnchorBehavior
    myGotoAnchorBehavior = myButton.gotoAnchorBehaviors.add();
    // Now I try to set the Anchor Target. I think that's not working...
    myGotoAnchorBehavior.anchorItem =myHyperlink;
    // END LOOP
    The Buttons are there, the Destinations as well, but the ceratin button has not the desired Page as destination. Does someone have a hint on this topic?
    Thanks and greets
    Stefan

    Hi Keith,
    myDoc.activeLayer = myDoc.layers.item("Layer 1");
    Kasyan

  • Changing hyperlink text colors.

    I saw few posts asking about changing hyperlink text colors. And there are many camps regarding this topic. Suzanne Boben would recommend editing template XML . Some would recommend editing published HTML code. Some would recommend editing CSS code.
    But it came down to couple things.
    1) proficient in XML, HTML or CSS
    2) tried different colors, but it did turned out as expected
    One easy way is editing CSS files, this only apply to pages' hyperlink text; if your text got turn to PNGs, read no further .
    iWeb generates a CSS file for the associated HTML page - CSS file is in the Page_files folder.
    Edit the CSS files and keep copies of them, then you won't have to edit them again the next time you publish you sites.
    These CSS files are quite easy to understand, all you have to do is to look for a { , a:visited { and a:hover { .
    They contain RGB (Red Green Blue) values for link color, visited link color and rollover color.
    But what about those #8000FF and #4c4c4c?
    Well, I know they are RGB hexadecimal color values, but I don't what colors they are, so I came up with Argiope (Argiope is a family colorful spiders).
    It's a colors picker application to help with choosing background color, link color and rollover color. It'll give you the exact RGB hexadecimal value of chosen color.
    You can find Argiope here. Enjoy

    It can be done, but I have to do too much works.
    I already have a a script to do that, but it's quite complicated for an average bear.
    http://www.geocities.com/[email protected]/iWeb_utils --> LinksColors.zip
    Does just that, it is flexible, you can configure the colors for individual page, but it is quite different to configure. Look at the colors.txt and page.txt.
    If you really want to know more, ping me.

  • Error message when hyperlink page not found

    I have setup hyperlink for one of the field. I would like to display error message when hyperlink page is not exists. Currently it displays standard page not found error.
    Message was edited by:
    user448086

    This sometimes is the result of firewall software protecting you from changed applications. Or it might be something else. Can you review this article and see whether it helps: [[Firefox can't load websites but other browsers can]].

  • Changing hyperlink text color...

    I see how to change hyperlink text colors for a page (normal, rollover, visited, active) but I am hoping for something more complicated- I would like a link to change color on rollover, but stay that color until another link is clicked, then return to its original color. ( I have a swap image applied to five links on a page, clicking on each word displays a different image.) Is there any code I can add that will get a link to remain a rollover color until something else is selected? Thanks in advance!

    CSS menus are much leaner and more efficient than image rollovers.
    Persistent Page Indicator on CSS Menus
    http://alt-web.com/Articles/Persistent-Page-Indicator.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Licence cs6 changed in a trial

    licence cs6 changed in a trial. How can I get my cs6 back. My activationcode does not work anymore

    Please refer:
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivat ion-products.html
    Click the Chat Now button at the end of the page and talk with a live agent who would resolve it ASAP.
    Regards,
    Ashutosh

  • Problem changing signout page in SquirrelMail

    As root, I used conf.pl (option 1 and then option 5) to change signout page (to some other page), saved it. I noticed the change in config.php. But when the user clicks on Sign Out, it is still usign the normal signout.php page. This does not happen in other linux distributions. Is there any other change to be made on Mac ?

    I haven't tried changing the sign-out page before....
    But if for some reason it doesn't work, you could always setup a redirect for /signout.php to the destination you choose.
    Jeff

  • Hyperlinked Pages Generate Unknown Printing Error

    I'm working in a 300+ page catalog that I've never had problems with. Today it decided to give methe following error when trying to print or export to a PDF:
    "Printing Error: The Adobe Print Engine has failed to output your data due to an unknown problem."
    The error shows up when trying to print from seperate computers and from CS4 AND CS5. I've trouble shooted the advice found here: http://kb2.adobe.com/cps/332/332622.html but I think it's something else.
    The odd thing is that I can print and export to PDF pages without hyperlinks or cross-sreferences. It's only when I try to print a hyperlinked page that I get the error. The only change I've made since the last time it printed/exported properly is adding a couple hundred more cross-references.
    I'm on a tight deadline and right now I can't get my file out of InDesign. Anyone have ideas?

    CU Dezigner wrote:
    This is interesting ...
    When I package the file and check everything off to be included it processes everything as it should EXCEPT it doesn't package the linked images. Then when I open the packaged copy of the document with broken image links I'm able to print ...
    So apparently the problem has to do with my images but it's only affecting pages with hyperlinks. This is weird.
    Well if that's the case open the images and do a save-as and see if they come good

  • Items not showing in preview browser on hyperlinked page

    Hi,
    This is my first thread.
    When I preview each page of my website in turn in the browser (both IE and Firefox) they displays perfectly.  When I check the hyperlink from the index page to the contact page the contact page displays with the library item nav bar missing. (all hyperlinked pages do the same thing).  Any ideas?
    Thanks,

    Whenever you post a questions about a specific page/problem, it is always best to post a link to the page so people can see the result and the code, even if this means you have to put it on a server (change the name/folder if your worried about the world seeing it prematurely, though I would not worry about it).  Post the code if that is not possible, but a link is much mo better.
    Gary

  • Changing my page size from American A4 to UK A4 shifts everything on the page, if I want everything on the page to stick to the top left rather than shift around, what do I do?

    Changing my page size from American A4 to UK A4 shifts everything on the page, if I want everything on the page to stick to the top left rather than shift to the right and down, what do I do?
    Using Indesign CS6.

    @Gabrielle – if you change the size in your document setup, pages always crop from the center of your spread, if you are using facing pages:
    Uwe

  • How do you can change the page size of a pdf in MAC?  I have multiple pdf documents of different sizes that I want to combine.

    Help.  How do I change the page size of a pdf in MAC?  I have multiple pdf documents in varying sizes I would like to combine and print.

    There's no real need to do that. A PDF can have pages of different sizes.
    On Fri, Jun 6, 2014 at 4:11 AM, christine rambo <[email protected]>

Maybe you are looking for