Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@438d1df3
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@33277eb9, com.xpn.xwiki.api.Object@65f0bdeb, com.xpn.xwiki.api.Object@2044c396, com.xpn.xwiki.api.Object@284bd67, com.xpn.xwiki.api.Object@58aeb67b, com.xpn.xwiki.api.Object@364e72b9, com.xpn.xwiki.api.Object@584deb89, com.xpn.xwiki.api.Object@63a29ca9, com.xpn.xwiki.api.Object@48db4e59]
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