Grapping caption from photoshop file

I’m trying to figure out how to grab the caption from a photoshop cs file and dump it into a variable. I see that it’s possible to import text into the caption field. But I want to grab the exisiting text from the caption and put it into a variable.

Thank you!

Nevermind, i got it!

tell application "Adobe Photoshop CS"
	tell current document
		set infoCaption to (caption of info) as text
	end tell
end tell

i just wrote an applescript that allows you do this: Select a picture box in Quark. Run the script, and it will automatically open the file in photoshop, grab the caption from the file info, close the photoshop document, and then copy the caption to your clipboard. SUH-WEET!

tell application "QuarkXPressâ„¢"
	tell document 1
		set filePath to file path of image 1 of current box
		if filePath is not null then
			set filePath to filePath as alias
			tell application "Adobe Photoshop CS"
				open filePath
				try
					set infoCaption to (caption of info) as text
					tell application "Finder"
						set the clipboard to infoCaption
					end tell
				end try
				close current document saving no
			end tell
		end if
	end tell
end tell