-- Copyright 2002-2008.  Adobe Systems, Incorporated.  All rights reserved.
-- Apply a layer style to all text layers
-- Before running, create a document with at least one text layer

tell application "Adobe Photoshop CS4"
	activate
	
	if ((count documents) < 1) then
		display dialog "You must have at least one document open before running this script"
		return
	end if
	
	set docRef to current document
	set artLayerList to get every art layer of docRef
	
	repeat with layerRef in artLayerList
		
		set current layer of docRef to layerRef
		
		-- discover if the art layer is a text layer
		if (kind of layerRef is text layer) then
			-- change the font of the text
			set textItemRef to text object of layerRef
			set size of textItemRef to 20 as points
			set text direction of textItemRef to vertical
			apply layer style layerRef using "Sunset Sky (Text)"
		end if
		
	end repeat
	
	
end tell