1 Reply Latest reply on Jul 24, 2013 10:27 PM by Mac_rk

    How to get colorSpace of pageItems

    shilpa25 Level 1

      Hellow forum,

       

      I can get alert for colorSpace of the swatches... like this

       

       

      var myIDOc = app.activeDocument; // alert RGB swatches

      var mySwatch = myIDOc.swatches;

      for (var j=4; j<mySwatch.length; j++){

       

              if(mySwatch[j].space ==ColorSpace.RGB){

          

                   alert(mySwatch[j].name);

                 }

       

      How to get alert,    if the any of a pageItems has RGB colour used; and i tried like this.. no luck...

       

      var myIDOc = app.activeDocument;

      var mySwatch = myIDOc.pages.item(0).pageItems.everyItem().getElements();

      for (var j=0; j<mySwatch.length; j++){

       

              if(mySwatch[j].fillColor.properties ==colorSpace.RGB){

           

                  app.select(mySwatch[j]);

                   alert(mySwatch[j].fillColor.space);

              

      }}      

       

      Please help me on this....

        • 1. Re: How to get colorSpace of pageItems
          Mac_rk Level 2

          check below code

           

          var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.pages.item(0).pageItems.everyItem().getElements();

          for (var j=0; j<mySwatch.length; j++){

                  if(mySwatch[j].fillColor.space ==ColorSpace.RGB){

                      app.select(mySwatch[j]);

                       alert(mySwatch[j].fillColor.space);

                  }

          }