5 Replies Latest reply on Jan 10, 2013 9:28 AM by shilpa25

    find PageItems & SplineItems - error

    shilpa25 Level 1

      Hi Forum,

       

      Iam trying to find, box filled with and stroke with same CMYK combination and then make an alert,

       

      below is the script i tried with, but when, box only is present inside the document or only the stroke is present the its alerts.

       

      When both box and stroke are present inside the document- no alert is produced.

       

      var mydoc = app.activeDocument;

      var mySItems = mydoc.splineItems.everyItem().getElements(); // I tried with splineItems and..

      var myPItems = mydoc.pageItems.everyItem().getElements(); //with pageItems..

      for (i=0; i<myPItems.length; i++) {

           myPItem = myPItems[i]

      if (mySItem.strokeColor.colorValue == "20,30,0,0")

      {alert ("BOX is filled with"+ ("\r") + myPItem.strokeColor.colorValue + ("="));}

      if (mySItem.fillColor.colorValue == "20,30,0,0")

      {alert ("BOX is filled with"+ ("\r") + myPItem.fillColor.colorValue + ("=") + myPItem.fillTint + ("% tint is used"));}

      }

      }

      can anybody correct this..

       

      thanks

      shil..