2 Replies Latest reply on May 17, 2017 5:44 AM by chas37922860

    Javascript syntax error

    chas37922860

      Hi,

       

      There is an issue with my javascript but having trouble identifying it.  The script is supposed to find and highlight words I want to react,  but must skip over anything that is already marked with overlaytext.

       

      This is what I have done so far ...

      - Using the "Actions" feature in Adobe I use the "Search & Remove" dialog to search for words I want to redact.

      - I then run the below JavaScript to highlight the words found in yellow

       

       

      var colHilite = ["CMYK",0,0, 1, 0]; // yellow

      var oDoc = event.target;

       

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

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

       

      {

                                  

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

       

        if ((overlayText != "Overlay1") || (overlayText != "Overlay2")); // This line seems to be causing issues, Skip highlight over words that have been marked with overlay

                                      }

          {

          aAnnts[i].type = "Highlight";

          aAnnts[i].strokeColor = colHilite;

       

          }

      }

       

       

      Thanks in advance for your help !

       

      Karl Heinz Kremeryellowtry67