.fill on layer gives an Error 24: .fill is not a function

244 views Asked by At

Hello I am writing a script that changes layer colors in photoshop the layers are circled in yellow

the layer type is NORMAL and my code is the following ...

function setClass2HexColor(){
   var doc= app.activeDocument;
   var colorGroup = doc.layerSets.getByName('COLORGROUP');
   var class2hex = colorGroup.layers.getByName('CLASS2HEX');
   var color = '7f7f7f7f'
   alert(color2hex.kind) // LayerKind.Normal
   class2hex.fill(color)
}

For some reason it says that class2hex.fill is not a function , Error 24... I would appreciate any advice on the matter...

I know that there is also a way to accomplish the same task with scriptListener... how would that be done ?

0

There are 0 answers