Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
For the active document
app.activeDocument.hyperlinks.count();
should give you the count of all the hyperlinks(all types) in the document
-Manan
Copy link to clipboard
Copied
How do I run this? I've never run a script before.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
No it didn't work. I got a syntax error.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
copy and paste this
alert("There are " + app.activeDocument.hyperlinks.count() + " hyperlinks in this document.");
into your scriptfile.
Copy link to clipboard
Copied
Thanks so much. I just found this post and the script worked like a charm. This will save me lots of billing time!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now