Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@ea10bb9
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@60773498, com.xpn.xwiki.api.Object@321e18a2, com.xpn.xwiki.api.Object@55e34d62, com.xpn.xwiki.api.Object@3ded88fb, com.xpn.xwiki.api.Object@35bc3680, com.xpn.xwiki.api.Object@579e290f, com.xpn.xwiki.api.Object@5099c4b9, com.xpn.xwiki.api.Object@1f427706, com.xpn.xwiki.api.Object@44943af2]
Retrieve all objects attached to this page and of class XWikiComments and one of their properties
objsAuthors = doc.getObjects('XWiki.XWikiComments').author
objsAuthor = doc.getObjects('XWiki.XWikiComments')[2].author
println objs[0].author
println objsAuthors
println objsAuthor