Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@13a4c054
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@7ccc4cab, com.xpn.xwiki.api.Object@48bdae8f, com.xpn.xwiki.api.Object@1d0f5398, com.xpn.xwiki.api.Object@59392f0f, com.xpn.xwiki.api.Object@3940af8c, com.xpn.xwiki.api.Object@45c52db1, com.xpn.xwiki.api.Object@143ae340, com.xpn.xwiki.api.Object@261d8920, com.xpn.xwiki.api.Object@5d15a76c]
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