what am i doing wrong?

I’m trying to get the resolution of selected image files.

here is the relevant script snippet:

tell application “Finder”
set selected_items to selection

repeat with this_item in selected_items
tell application “Image Events”
launch
set this_image to open this_item
tell this_image
resolution
end tell
end tell
end repeat
end tell

I keep getting the error that this_image is not defined. What am I doing wrong here? :frowning:

Sorry for a really newbie question. I’m just learning.:frowning:

Model: Powerbook G4, 1.5GHz
Browser: Firefox 2.0.0.11
Operating System: Mac OS X (10.5)

Hi,

welcome and Merry Christmas :slight_smile:

System Events expects an alias, not a file specifier of the Finder,
you should also release (close) an image after using it.


tell application "Finder" to set selected_items to selection
tell application "Image Events"
	launch
	repeat with this_item in selected_items
		set this_image to open this_item as alias
		tell this_image
			resolution
		end tell
		close this_image
	end repeat
end tell

thanks a lot!
that was it! :slight_smile: