3 Replies Latest reply on Jul 23, 2009 3:13 AM by R_Thangaraj

    how to change Object Stroke Color and fill Color?

    R_Thangaraj

      Hi to all

      i need to change fillcolor & stroke color of Object

       

      here i wrote code that tried but it is not

       

      myDoc = app.activeDocument;

      var dd = myDoc.colors.add({name:"PANTONE Black C", model:ColorModel.spot, colorValue:[0, 13, 49, 98]});

      app.findObjectPreferences= NothingEnum.NOTHING;
        app.changeObjectPreferences = NothingEnum.NOTHING;
        app.findObjectPreferences.fillColor = "Black";
        var myI1 = myDoc.findObject();   
         app.changeObjectPreferences.fillColor = "PANTONE Black C // here error throwing

          app.changeObject ();

       

      app.findObjectPreferences= NothingEnum.NOTHING;
        app.changeObjectPreferences = NothingEnum.NOTHING;
        app.findObjectPreferences.strokeColor = "Black";
        var myI2 = myDoc.findObject();   
         app.changeObjectPreferences.strokeColor = "PANTONE Black C // here error throwing

          app.changeObject ();

       

       

      Error is :  Invalid value for set property 'fillcolor' ,Expected Swatch, String or NothingEnum enumerator, but received "PANTONE Black C";

       

      pls help me...

       

      Thanks

       

       

      Thangaraj