IDCS2 Image file name

Dear All,

Please see below code, I am trying to get the image name. But I am not getting it, please see the below code and suggest me.

tell application "Adobe InDesign CS2"
	set myDoc to front document
	tell myDoc
		set ImgCounter to get count of rectangle
		repeat with i from 1 to ImgCounter
			set ImgName to get file name of image 1 of rectangle i as string
			display dialog ImgName
		end repeat
	end tell
end tell

Thanks

Hi,

file name is no property of image.
Try this, it works at least in CS3


tell application "Adobe InDesign CS2"
	set myDoc to front document
	tell myDoc
		set ImgCounter to get count of rectangles
		repeat with i from 1 to ImgCounter
			set ImgName to name of item link of image 1 of rectangle i as string
			display dialog ImgName
		end repeat
	end tell
end tell