Linked Smart Objects

Is there a way to see which smart objects are “linked” or “synced” together with a Script?
I am trying to create a dialog that shows all of the smart objects layers and which smart objects they are linked to.

By linked/synced, I mean when I update a smart object, I want to know which other smart objects will updated. Sometimes they can be similar smart objects, but not linked up with eachother.

I have the script working, however, it is showing all of the smart objects being linked to eachother, even if they are independent.

Hopefully that makes sense. It kind of hurt my head typing it out haha

There is a “fileReference” property in the “smartObject” property in the Layer properties that might be helpful. Not sure, but the “smartObject” properties might be a place to start.

Thank you for the reply! Looks like you may be able to find out the reference, if the smart object is linked by a file outside of the current document, but my use would be for the current document.
It’s not too big of a deal, I created my script without it.