getting clipboard dimensions in PhotoShop

Anyone know how to get the dimensions of the clipboard when scripting in PhotoShop?

tell application "Adobe Photoshop CS3"
	
	activate
	tell current document
		select all
		copy merged
	end tell
	clipboard info
	
end tell

returns {{picture, 5134}}

Hi Roland,

there is no way to get the dimensions of the clipboard with AppleScript.
clipboard info returns only a list of class and size pairs of the contents.

I noticed that “the clipboard” returns the entire clipboard and in this case it is a PICT… and the dimensions could be discerned from the header… the hex codes at a certain offset. The problem with this is “the clipboard” can be very large and AppleScript isn’t so fast dealing with that amount of data.

For now, I’ve added globals that record the clipboard dimensions when the copy happens, since the script is doing the copy.

I’m just getting the hang of AppleScript, coming from a background of just about every other programming language. It’s funny how AppleScript does all this cool stuff then has baffling gaps in implementation. But overall, I’m liking it. :slight_smile: