Copy link to clipboard
Copied
Has anyone created an action, similar to the find and highlight, from the masterful Lori Kassuba, to create a count of the number of highlighted words in a document?
I need to create a pdf, highlight a set of words/phrases from a list and know how many occurrences, preferably unique (that is to say, the first occurrence of each unique word/phrase highlighted) exist.
Failing that, if anyone could point me to a resource for creating the action, that'll work too.
Thanks in advance 😉
Copy link to clipboard
Copied
If the highlights contain the search term as their contents then you could do it with a script that loops over all the comments (annotations) in the file and checks their type and contents properties for unique values.
Copy link to clipboard
Copied
If you downloaded that Action from the Actions Exchange at AcrobatUser.com, then I wrote it. The entire action is written in JavaScript, and Lori is not a programmer.
To get a word count you can simply multiply the number of highlight annotations by the number of words in the search.
Another approach would be to modify this action to keep a running count of the words found. However, Extracting the script is a bit of a trick. It was writtin for Acrobat X, and will not open in the Actions' editor in Acrobat DC. However, you can get to the script by editing the XML.
Copy link to clipboard
Copied
Thom,
Thanks very much for the insight. Any thoughts on an efficient way to obtain a count of the first occurrence of each highlight?
Copy link to clipboard
Copied
Do you want to count the number of occurrences or do you want to know which search terms had a match? Either way, you would need to use a custom-made script to do it.
Copy link to clipboard
Copied
Thanks for the question. Actually, I just need the count per search term; that'll give me both data sets.
Copy link to clipboard
Copied
To create a solution you need to either
1) find something unique about the highlights that a script can detect, so they can be counted,
You can obtains a list of all annotations on the PDF with
var aAnnots = this.getAnnots();
This list can then be filtered for specific characteristics, which will give you the count.
The trick is determining the criteria for filtering.
2) modify the existing script to add in the counting feature you want.
I would be happy to do this for a fee. Contact me through www.windjack.com
Copy link to clipboard
Copied
Thom,
That's really helpful! Let me give that try and I'll get back to you.
Many thanks for your time and insight.