-- Copyright 2002-2008.  Adobe Systems, Incorporated.  All rights reserved.
-- Store a reference to the document with the name "My Document"
-- If it does not exist , display an error message

tell application "Adobe Photoshop CS4"
	activate
	
	try
		set docRef to document "My Document"
		display dialog "Found 'My Document' "
		
	on error
		display dialog "Couldn't locate document 'My Document'"
	end try
	
end tell