0 Replies Latest reply on Aug 12, 2013 11:40 PM by surendarappu

    CMYK values to fill in object error

    surendarappu Level 1

      Hi any one help me to modify the below code to get all the cmyk value used in existing object

       

      here is my code

       

      in function rec. i get only one vaule of cmyk

       

      var docRef = app.activeDocument;
      var iL=docRef.pageItems.length;
      //var mytext=docRef.textFrames;

      for (i=0;i<iL;i++)
      {
           myItem=docRef.pathItems[i];
              
                if (myItem.fillColor=="[CMYKColor]" && myItem.selected)
                {
       
                  var c=myItem.fillColor.cyan;
                  var m=myItem.fillColor.magenta;
                  var y=myItem.fillColor.yellow;
                  var k=myItem.fillColor.black;
                  //alert ("pathItem number:"+i+" \n cyan: "+c+" \n magenta: "+m+" \n yellow: "+y+" \n black: "+k);
                  rec();
                }
                
      }
      function rec()
      {

       

      var rect = docRef.pathItems.rectangle(-100,-100,26,26) ;
      var col= new CMYKColor();
      col.cyan = c;
      col.magenta = m;
      col.yellow = y;
      col.black = k;
      rect.fillColor=col;
      };

       

      Thank you

      Appu