0 Replies Latest reply on Nov 30, 2015 6:34 AM by phile1839162

    Counting Sticky Notes

    phile1839162

      I am trying to use sticky notes to count the number of times something appears graphically on a PDF, say, for instance, a lighting fixture.  I have used the below script to count ALL sticky notes in a file.  I would like to be able to count only visible sticky notes and not ALL stickies.  For instance, I would have, say, 2 sticky notes, in the shape of a circle, one labeled LX1 and the other labeled LX2.  If I type into the search on the bottom right LX1 and click on the button to run this script, I would like the script to return a value of 1, NOT 2.

       

      Any help would be greatly! appreciated

       

      -Phil

       

       

      function countcomment()

      {var counter = 0;

      var annots = this.getAnnots();

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

          if (annots[i].type == "Text") {

              counter++;

          }

      }

      app.alert("Total fixture type count: " + counter);

      }

       

       

      app.addToolButton({

             cName: "helloWorldBtn", // A name for your button

             cExec: "countcomment()", //Function to Call

             cLabel: "Number of Selected Type Fixture", //The Text on the Button

        

      });

       

       

       

       

       

       

          /////cTooltext: "Say Hello World" //The Help Text