Determine if image view has an image?

Is there a way to check to see if an image view has an image in it?

I tried this:

set imageID to image id of image view “bigimg1” of window “mainWin”
log imageID

but it only returns “”

if I log image id of image view “bigimg1” of window “mainWin” then I get:

image 18 of image view “bigimg1” of window “mainWin”

Is image 18 a default for no image (I looped through all the image views and those without images returned the same id)


Hi RIRedinPA

from the below If I load 1 image _id shows the number 1, then I delete image from viewer and load
another image _id shows 2, and so on so I am guessing that it will just keep counting the amount of
images that I have loaded etc, cant seem to get much more than that at the moment.

set _id to id of image of image view “bigimg1” of window “mainWin”
delay 1
tell application “Finder”
display dialog _id
end tell


to imageViewHasImage(anImageView)
		id of (image of anImageView)
		return true
	on error
		return false
	end try
end imageViewHasImage