You really need to read the scripting guide.
Application is a Photoshop Class. To reference that class you use app. So the first line in the function should be app.activeDocument. Even then that line does not do anything except return a document object. If you do not store the returned object in a variable you might as well delete that line.
app.backgroundColor is an app property, not a method. So the () are not used. That property either returns a SolidColor object that is the current background color or you can assign it a new color something like this
var myColor = new SolidColor();
myColor.rgb.red = 1;
myColor.rgb.green = 12;
myColor.rgb.blue - 34;
app.backgroundColor = myColor;
But that does not create a new layer and I am not sure what kind of layer you want. Do you want to create a new artLayer then fill it with your color or do you want to create a new SolidFill adjustment layer using that color.
To create a new artLayer you do something like
To create a new adjustment layer you would need to use Action Manager( scriptlistener ).
a layer has not a background color. And your code is fully wrong. Search in the OMV for the properties of document and layers.
// http://forums.adobe.com/thread/1248703?tstart=0 // LayerFillWithDefinedColor.jsx // regards pixxxelschubser // define your color aColor = new SolidColor(); aColor.rgb.red = 1; aColor.rgb.green = 12; aColor.rgb.blue = 34; // define your document var aDoc = activeDocument; // fill the active layer, but be sure, this is an artLayer ! aDoc.selection.fill( aColor); // add a new layer var aLayer = aDoc.artLayers.add(); // and fill again aDoc.selection.fill( aColor);
I was too slow. And what Michael L Hale said.
I will review the scripting guide. The script posted, has cleared up a little for me, thanks
I think your behavior is hardly fair.
Why you not marks the correct answers as helpful or correct?