Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@15158d38
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@4a2d9e53, com.xpn.xwiki.api.Object@78f58130, com.xpn.xwiki.api.Object@3df4b45a, com.xpn.xwiki.api.Object@c6ca07d, com.xpn.xwiki.api.Object@2f9c74ea, com.xpn.xwiki.api.Object@48bfc711, com.xpn.xwiki.api.Object@26a65267, com.xpn.xwiki.api.Object@716bfc03, com.xpn.xwiki.api.Object@686e6321]
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