Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Hyperlink count?

Explorer ,
Aug 30, 2012 Aug 30, 2012

Hello Adobe friends!

I was wondering if there is any way to count the hyperlinks you've made in a document? I made text anchors to link "questions" and "answers" back and forth in a book and a gloassry at the back of the book that I linked to text anchors thoughout the book. I was wondering if there's any way of counting these without actually going through the whole 300 page document and manually counting them? Hopefully this makes sense! Thanks. I'm also working with inDesign 6 on a Mac.

Sandra.

TOPICS
Scripting
3.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 30, 2012 Aug 30, 2012

For the active document

app.activeDocument.hyperlinks.count();

should give you the count of all the hyperlinks(all types) in the document

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 30, 2012 Aug 30, 2012

How do I run this? I've never run a script before.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 30, 2012 Aug 30, 2012

In InDesign go to the scripts panel, on WIN you can open it using (Windows>Utilities>Scripts) i don't have access to my MAC at the moment but you can find the panel it will be in the same place or some search can get you there.

Inside the script panel expand the Javascript folder icon, right click on any script and click on "Edit Script". This will launch the Adobe Extendscript toolkit. Create a new file, paste the code above in that file, save it at the location where other scripts(i.e. the one you clicked to edit) are placed otherwise you won't see the icon for this script within InDesign scripts panel. Once this is done you can launch the script by just clicking on it's icon within InDesign's script panel.

Hope this helps

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 30, 2012 Aug 30, 2012

Were you able to get the script running and did it solve your problem?

It's a good practice to update the post in response to the answers, whether they helped/solved your problem or not,

If they did not then others users can chip in with more suggestions. In this way all users of the forum benefit with the quality and accuracy of the content.

Thanks

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 31, 2012 Aug 31, 2012

No it didn't work. I got a syntax error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2012 Aug 31, 2012

What was the error? Did you use the ESTK to make the script or just a text editor? If it was just a text editor, make sure that the file is saved as plain text only not RTF as is the case in many editors.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 03, 2012 Sep 03, 2012

copy and paste this

alert("There are " + app.activeDocument.hyperlinks.count() + " hyperlinks in this document.");

into your scriptfile.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2013 Jan 22, 2013
LATEST

Thanks so much. I just found this post and the script worked like a charm. This will save me lots of billing time!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines