Detect if link/Image is on InDesign master page


I spent some hours to find a solution to discover if one of the image of my InDesign doc coming from one of the master pages.

Starting from link I can get image parent and from this the parent page.
But in the properties of parent page there are not trace if the page is a normal page or master page.

Somebody has already solved this?


I had an “illumination”

tell application "Adobe InDesign CS5"
	tell active document
		set imgRif to parent of link 1
		set parentPage to parent page of imgRif
		if parentPage is not nothing then
			set objectRef to parent of parentPage
			set objectClass to (class of objectRef) as string
			set objectClass to "pasterboard"
		end if
	end tell
end tell

– return “spread” for normal pages
– return “master spread” for master pages
– return “pasteboard” is image is out of the page

If somebody have other solutions, please post :wink: