Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@3dd60a9e
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@174ad840, com.xpn.xwiki.api.Object@32bb5db2, com.xpn.xwiki.api.Object@2b046b23, com.xpn.xwiki.api.Object@2f15dce5, com.xpn.xwiki.api.Object@44595689, com.xpn.xwiki.api.Object@45405f6d, com.xpn.xwiki.api.Object@53910a0, com.xpn.xwiki.api.Object@65727b0d, com.xpn.xwiki.api.Object@3eecc683]
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