1 Reply Latest reply on Feb 7, 2013 1:18 AM by R-Bala-Krishnan

    Need alert when image size exceed trim

    BEGINNER_X Level 3

      Dear All,

       

      Requirement:

       

      We have 100+ images in the source document. If any image exceed the trim (i.e., pagewidth, pageheight) we need alert (image name).

       

       

      Trying script is:

       

      var pagewidth = app.activeDocument.documentPreferences.pageWidth;

      var pageheight = app.activeDocument.documentPreferences.pageHeight;

      app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

       

      app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

      app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

       

       

      var myDocument = app.activeDocument

      var myGraphics = myDocument.allGraphics

       

      for(i=0; i<myGraphics.length; i++)

      {

          //var myGraphicsAll = myGraphics[i]

          if(myGraphics[i].parent>pagewidth)

          {

              alert(myGraphics[i].name)

              }

          }

       

       

      Can anyone give solution for this script.

       

      Thanks in advance

      BEGINNER