5 Replies Latest reply on Jan 11, 2013 10:29 AM by Leo Tse

    Action that finds specified words and highlight the whole sentence or paragraph

    Leo Tse

      Hi All,

       

      I know a action file from Acrobat users group (http://acrobatusers.com/content/find-highlight-words-and-phrases) which find and highlight a set of words using Acrobat action. But, is this possible to modify the javascript to select and highlight the "whole sentence" of the word selected? I have no knowledge about javascript, but hope I can learn how to search a word and grab the sentence or even the paragraph that a selected word appears in!

       

      Thanks a lot for all your help.

       

      I copied the said javascript in below:

       

      / Highlight Color

      var colHilite = color.yellow;

      var oDoc = event.target;

       

       

      var aAnnts = oDoc.getAnnots({sortBy:"Author"});

      for(var i=0;i<aAnnts.length;i++)

      {

         if(aAnnts[i].type == "Redact")

         {

            aAnnts[i].type = "Highlight";

            aAnnts[i].strokeColor = colHilite;

         }

      }