Overlay Layer in CS2

I am trying to make an applescript to make an overlay layer in Photoshop CS2. If i make the overlay manualy it works differently than my script and i think it is because i cannot do the checkbox “Fill with overlay - neutral color (50% gray)”. Below is what i already have. Can someone show me how to check the box when a new layer is made.

tell application "Adobe Photoshop CS2"
	set docRef to the current document
	tell docRef
		set MyLayerDupe to duplicate current layer to beginning
		set current layer to layer 1
		set properties of layer 1 to {name:"Overlay Layer", opacity:100, blend mode:overlay}
	end tell
end tell

I am fairly new to Applescript so I may have not explained very clear what i wanted to do. What I want to do is when a photo is open in PhotoShop I want to open a new layer, name the layer, set the color to none, set the mode to overlay, set opacity to 100 and check the box to “Fill with Overlay - neutral color (50% gray)” so it will be true.
Could someone please show me how to set these properties in new layer.
Thanks
PolishPrince

Hi Polish

I’m not 100% on this but i don’t think what you are trying to acheive can be
done like you want.
i think you are looking at how you would do it manually in photoshop and a lot of the
commands aren’t in the photoshop dictionary.
Here’s my attempt at what you want:

tell application "Adobe Photoshop CS2"
	activate
	tell document 1
		change mode to CMYK
		make new art layer at beginning with properties {name:"overlay", blend mode:overlay}
		select all
		fill selection with contents {class:CMYK color, cyan:0.0, magenta:0.0, yellow:0.0, black:50.0}
	end tell
end tell

i don’t think you need to set the fill color to none cause by default a layer is empty!
also by default the opacity is 100% so this doesn’t need changing!
you can’t really do the 50% gray you want the way it is in the interface so you just have to create a 50% Gray out of black!
it’s exactly the same result done via the script i created! has if you would do it by using the photoshop interface.
Now i could be wrong cause i don’t know exactly what you want but try it anyway…

Hi Pidge1

Thanks for the reply. You are right about the default settings and i see i was duplicating the layer instead of creating a new one. It is working now.

PolishPrince