Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@61b38444
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@5836297b, com.xpn.xwiki.api.Object@4bdd777b, com.xpn.xwiki.api.Object@38cf5326, com.xpn.xwiki.api.Object@335c00ed, com.xpn.xwiki.api.Object@5d40e1f2, com.xpn.xwiki.api.Object@4eb206b2, com.xpn.xwiki.api.Object@9d5b87b, com.xpn.xwiki.api.Object@2e429848, com.xpn.xwiki.api.Object@161bb6b2]
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