2 Replies Latest reply on Aug 16, 2012 9:53 AM by stoereee

    [JS][ID5] Get allGraphics except those within tables

    stoereee Level 1

      The following script iterate over all graphic with a document:

       

      var myDoc = app.activeDocument;
      var myImages = myDoc.allGraphics;
       
      for (i=0; i<myImages.length; i++)

       

      Could there be iterating over all graphics except those who are placed within tables?

       

      Regards, Sjoerd

        • 1. Re: [JS][ID5] Get allGraphics except those within tables
          Trevorׅ Adobe Community Professional

          Sjoerd

           

          This should be Helpful, although I can see some pitfalls

           

          var myDoc = app.activeDocument, myImages=myDoc.splineItems, v=myImages.length;
          while (v--) if (myImages[v].parent.parent.constructor.name != "Cell") myImages[v].fillColor="C=0 M=0 Y=100 K=0"
          

           

          Trevor

          • 2. Re: [JS][ID5] Get allGraphics except those within tables
            stoereee Level 1
            var myDoc = app.activeDocument, myImages=myDoc.splineItems, v=myImages.length;
            while (v--) if (myImages[v].parent.parent.constructor.name != "Cell") myImages[v].fillColor="C=0 M=0 Y=100 K=0"
            

             

             

            Thanks Trevor, this was very helpful! Finally the following script works for me:

             

            var myDoc = app.activeDocument;
            var myImages = myDoc.allGraphics;
            
            for (i=0; i<myImages.length; i++)
            {
                if (myImages[i].parent.parent.parent.constructor.name != "Cell") {
                    myImages[i].horizontalScale = 50;
                    myImages[i].verticalScale = 50;
                }
            }