PDA

View Full Version : PS Script - Change Layer Color.



MaxCode
April 22nd, 2010, 09:47 AM
Hello,

(Hope This Post Is In Right Section...)

http://forums.adobe.com/servlet/JiveServlet/downloadImage/25683/450-220/2.JPG

I Have A Photoshop File Which Looks Like Shown Above..



The Text 1 2 3 ...15 Are Different Layers..

And The Boxes Are Different Layers, Named i1 i2 i3 ...... i15

I Want To Write A Script That Will Change The Color Of Boxes (Actually This Is Legend Section For A Pie Chart)


I Want To Write Very Hard-Coded Script, Nothing Dynamic,

Like

layer[i1].color = #9f13a8
layer[i2].color = #520457
layer[i3].color = #cc626c
layer[i4].color = #aa5705


I Tried Searching Around, But Very Less Help Available On ps-script And Complicated Examples....


I Just Want Some Simple Lines, How To Easily Reference A Layer By Name And Change The Color (Forecolor, I Guess)


I Wrote This But It Does Not Works


var myDocument = app.activeDocument;
var myLayer;

myLayer=myDocument.artLayers.getByName("i1");
myLayer.color="#9f13a8";I Don't Know If .artLayers Is Only For Text Layers Or Something.. I Found It In An Example...

Thanks