Skip to main content
July 20, 2009
Question

how to change Object Stroke Color and fill Color?

  • July 20, 2009
  • 1 reply
  • 1636 views

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

This topic has been closed for replies.

1 reply

July 21, 2009

hi to all

yesterday onwards i'm waiting for reply but nobody giving atleast one helpful answer

Thanks

Thangaraj

July 23, 2009

Hi to all

here attached script that i tried but it won't work

it showing name as "(Unnamed Color)" in FindObject dialog box

How to change this Unnamed Color to my preferred Color

pls help me

July 23, 2009

query.JPGHi scriptor,

how to create find change query for object search

pls tell me with script.

here i attached one jpg file screen shot to understand my need

Thanks

Thangaraj