1 Reply Latest reply on Jun 18, 2014 4:43 AM by Laubender

    Empty Graphic Frames

    banl_05 Level 1

      Hi Friends


      I try to delete empty graphic frames. So i use the below code


      function EmptyGraphicFrame(){

          var myGraphicFrames = app.activeDocument.rectangles;


          for (i=myGraphicFrames.length-1; i>=0; i--) {

              var color = myGraphicFrames[i].fillColor.name; 


              if (myGraphicFrames[i].graphics.length < 1 &&  color == "None" )







      But the above code delete table present in graphic frame (graphics.length return 0)




        • 1. Re: Empty Graphic Frames
          Laubender Adobe Community Professional & MVP

          @Balaji – if "something" is nested inside of your rectangle, use the allPageItems array of that rectangle to detect this:


          //Rectangle selected:
          var myRectangle = app.selection[0];
          var allInRectangle = myRectangle.allPageItems;


          A table is not part of a graphic.

          It's part of a text frame or sits nested in a table cell.