Indesign placed image Fig No

Firstly - many thanks to those that contribute to my post here, any help is much appreciated I can assure you…

I have an Indesign document that contains a number of pages and, on each page there are a number placed images with their “Fig 1” etc identifier text just below them… there is also other text on these pages.

I have written an AppleScript to record the Image name, what page it sits on and the link reference for each, but how can I get the “fig No” it’s associated with?

Thanks

If you’re using the Live Caption function, you need to retrieve the text variable instances: select the text frame or the text containing the caption and run the following snippet.
If not, we need to rely on your script and a page example from your Indy document.

tell application id "InDn"
	result text of item 1 of text variable instances of selection
end tell