3 Replies Latest reply on Sep 14, 2010 3:14 PM by try67

    Hide annotations of a specified color

    JohnGBPack

      I know next to nothing about scripting, although I have spent considerable amount of time examining the js_developer_guide.pdf and similar resources.

       

      I need to show/hide all annotations of a particular color, for example all annotations that have a "red " fill color.  The below script seems to find and hide only the first instance of a "red" annotation.  It doesn't continue on to find and hide all other "red" annotations.  Any help would be greatly appreciated.

       

      this.syncAnnotScan();
      var myAnnotList = this.getAnnots();
      for (var i=0; i<myAnnotList.length; i++)
      {
      if (color.equal(myAnnotList[i].fillColor, color.red))
      myAnnotList[i].hidden = true;
      }