1 Reply Latest reply on Feb 22, 2013 2:06 PM by Jump_Over

    hiding a dynamic grapic box if no picture is detected

    Infamous_Concepts

      Hello All,

       

      im working with many documents that have a dynamic graphic box in them. I want to know if it is possible to create a script that will search through all layers and find what layer has an empty graphic box, then hide it. This will be a big help.

       

      Many thanks.

        • 1. Re: hiding a dynamic grapic box if no picture is detected
          Jump_Over Level 5

          Hi,

           

          try this:

          var MG = app.activeDocument.splineItems.everyItem().getElements();
          var Mgr = app.activeDocument.groups.everyItem().getElements();
          var k1, k2, SpIt;
          
          k1 = Mgr.length;
          while(k1--) {
              SpIt = Mgr[k1].splineItems.everyItem().getElements();
              MG = MG.concat(SpIt);
              }
          
          k2 = MG.length;
          while(k2--) {
              if(!MG[k2].graphics[0].isValid)
              MG[k2].visible = false;
              }
          

           

          asummed: some boxes can be grouped but group inside group stay untouched.