-- Copyright 2002-2008.  Adobe Systems, Incorporated.  All rights reserved.
-- This script shows how to apply a layer style to a layer

tell application "Adobe Photoshop CS4"
	activate
	make new document
	
	-- First we fill the background layer with red
	select all current document
	set background color to {class:RGB color, red:255, green:0, blue:0}
	clear
	
	-- Now we want to change the layer style. A Background layer does not have a 
	-- layer style, so we change the background layer to be a normal (art) layer
	-- before changing the layer style
	set background layer of layer 1 of current document to false
	apply layer style art layer 1 of current document using "Blue Glass (Button)"
	deselect current document
end tell
