is now part of CreativePro.com!

Making Text Anchors the Fast Way

22

Here’s a trick involving making text anchors in InDesign that Anne-Marie pointed out to me in a recent podcast. Like so many great tips, it’s painfully simple (in the way of, “how could I have overlooked that?!”) and makes life much better once you know it.

As I’ve pointed out in various places (including my 10 things you need to know about Interactive PDF title at lynda.com), you cannot make a navigation button that takes you to directly to a specific page… like “go to page 13.” Acrobat, for whatever reason, can’t deal with such clear communication. (This does work if you’re exporting to SWF, by the way; just not PDF.) So instead you have to first create a text anchor, then navigate to that.

Unfortunately, the path to making a text anchor is not a happy carefree one. First of all, you need to find the New Hyperlink Destination feature in the Hyperlinks panel flyout menu, then… well, believe me, it’s a pain in the neck.

So, imagine my surprise when Anne-Marie started talking about the little anchor icon in the Bookmarks panel. I had never seen that icon there because I had never made a bookmark with text selected! But if you do select text before creating a new bookmark (by clicking the New Bookmark button in that panel), you get a bookmark and a text anchor. It’s so easy! InDesign even highlights the bookmark name so you can rename it:

Once you have the anchor in the Bookmarks panel, you can point to it from the Buttons panel:

I love the speed and ease of this method of creating text anchors. There is only one problem that I can think of: The anchors show up in the Bookmarks pane in Acrobat (if someone opens that pane there). The solution: Leave the Bookmarks checkbox off in the export PDF dialog box. You still get the anchors, but no bookmarks. Now, if you want some bookmarks but not these text anchors? Hm. Well, I guess you could go back to the old hyperlink destination method… sigh.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • I use that tip (that Dave Saunders showed me when CS2 came out) to place anchors in strategic places in a document, places I need to go often back and forth. Now we have page thumbnails but they are not always easy to use because the preview is relatively too low.

  • Harbs says:

    Cool tip!

    Hmm. This is one of those places where a very simple script can save a lot of clicking… ;)

    I just whipped one together here: https://in-tools.com/downloads/indesign/scripts/InsertHyperTextAnchor.zip

    (It creates the text anchors named with the currently selected text. It does not create the bookmarks.)

    Hope it’s useful! :)

  • Anne-Marie says:

    Thanks Harbs!

    David, when you said “Now, if you want some bookmarks but not these text anchors? Hm …sigh”… not sure why that’s an issue. When would a text anchor get in the way? (as far as I know, bookmarks *are* anchors … it’s a featurenotabug).

  • Harbs says:

    @AM: “Text Anchors” in InDesign are not bookmarks. The true name for anchors are “hyperlink text destinations”. Bookmarks are a different animal…

    I agree with David. I would not necessarily want bookmarks to every place in my pdf that’s a hyperlink destination. (cross-references anyone?) ;) I generally stick to TOC created bookmarks…

  • Harbs says:

    Hmm.

    I just noticed that we are talking buttons — not hyperlinks. This trick does not work for hyperlinks — only for buttons.

    After a bit of research, it seems that the bookmark panel creates a “hidden” hyperlink text destination which only appears in the dropdown of the button panel, but not the dropdown of the hyperlinks panel.

    I have a sneaky suspicion that this trick is really the result of a bug in the button dropdown…

  • Harbs says:

    Just to clarify what I wrote above:

    Creating a new bookmark creates a new hyperlink text destination which is marked as hidden. (You can check that with scripting.)

    The hyperlink panel honors the hidden attribute and does not show the hyperlink destination in the dropdown.

    The button panel does not honor the hidden attribute and exposes the hidden destinations. This leads me to believe that it’s the button panel which is “broken”.

  • Tav Campbell says:

    A get-out-of-jail follows. Purists, please look away.

    Recently I was dealing with an InDesign file that viewed as a website. It was designed to become an on-screen PDF, and it was full of page links.

    I tried making the page links in InDesign and as you say, a simple ‘click this and you’ll jump to page 7’ was too hard… frustratingly, it did work for some links, but no matter how many reattempts at the file I pursued, it wouldn’t work with all of them.

    I was looking down the barrel of making up 80 text anchors and then re-setting up the links to look for the anchors instead of a page number….

    So… I made invisible buttons in Acrobat on the final PDF instead. Page number links worked fine there. It’s not pretty, but it was fast!

    I had allowed hours to set up the interactive elements in InDesign, only for it to go wrong. But I was able to set them up in Acrobat in a half hour (copy, paste, change the button name and page destination) and make my deadline.

    Just one for the toolbag! Now I’ve seen this method for taking some of the doublespeak out of setting up page links in InDesign, I’ll have another look!

  • I have followed these instructions closely but my Bookmark is not showing up in the Button Panel. I really have set the Bookmark, but there is nothing chose or click or name in the Button Panel.

    I’m just trying to set up links/anchors in this document. I don’t think this should oughta be so hard. Or I need another cup of caffeine!

    Thanks for any help!

  • @Celeste: Gah! You are correct that this does not seem to work in version 6.04 now. Perhaps Harbs was right in his comment earlier than this was actually a bug, and perhaps they fixed the bug and broke this great trick! Grrr.

  • Leslie says:

    I followed your discussion, but do not have the pull down in the Buttons Action List. Would you please explain how you did this. I have not been able to find this option either in CS4 or CS5 InDesign. Thank you.

  • Leslie says:

    I can send you a screen shot of the pulldown to show you if you have the facility to add attachments here.
    Thanks again.

  • Jongware says:

    Leslie, did you read the 2 posts immediately before yours? The “version 6.0.4” mentioned is your CS4.

  • Bruce Coorpender says:

    The technique works well in so far as creation of a text anchor that can be referred to by a button, but it does not seem to work if you wish to refer to the anchor via a hyperlink.

    After creating several text anchors by the method described, I was able to refer to them by a button, but they do not appear in the Hyperlinks Destination Options menu.

    My use does not require bookmarks but it does need hyperlinks. I used the script referred to by Harbs and it works very well.

    Bruce

  • Harbs script is a real time saver when you need to create hyperlink text anchors. Love this… Assign a key to the script and you can rapidly create them. Now need to find a way to execute the script on a specific character or Paragraph Styles. ;-)

  • Lisa says:

    Thanks, Harbs, for your script above?what a lifesaver!
    I don’t know anything about writing java script, but would love to know how to edit your script to make new versions that name the hyperlink destinations with a prefix or suffix ? eg. if highlighted text is “10.”, can I make the text anchor name “Sect A 10.”, without affecting the actual text in the documents? I want to duplicate the script for various scenarios in a complicated ebook file.
    Thanks!

  • yoohoo says:

    ok. but when u made a text anchored bookmark and when you copy the text coz u wanna use it somewhere else and coz it’s easier copy and paste instead of typing up again, so when u do that, it keeps the anchor. how the hell do u remove that nasty anchor :S i’ve been trying to find this out for days and it seems impossible :(
    i agree with tav, a lot easier to do linking and stuff in acrobat professional :S

  • Frederick Yocum says:

    @yoohoo I think, if all you want is the text ? no hypherlink information, no styling etc. ? then Edit/Paste without Formatting (Shift+Cmd+V) is your friend. This will just give you the text. Once you learn the shortcut, it is as fast as normal pasting.

  • katie says:

    THANK YOU!!!!!! I took on the project of creating a Kindle book with literally no experience. The Table of Contents has been tripping me up for days. This helped so much with getting the TOC to appear in Kindle.

  • Annie says:

    I’m late to the party, but THANK YOU Harbs for the script! It’s amazingly helpful.

    This was originally posted on my birthday, so I’ll take it as a gift – thanks!

  • Scott says:

    Harbs,

    You are my savior. I bow down to your awesomeness. You have saved me hours of work, and a little bit of my sanity.

    Thank You for the awesome script!!!!!!!

  • surgery says:

    Wow that was strange. I just wrote an really long comment
    but after I clicked submmit my comment didn’t show up.

    Grrrr… well I’m not writing all thazt over again. Anyhow, just wanted to
    say superb blog!

  • Mike Rankin says:

    To reduce spam, comments have been closed for this post. If you want to start a related discussion, head over to the Forums and create a new topic.

  • >
    Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo