Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@2cbb5393
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@2aec40fe, com.xpn.xwiki.api.Object@7c9ef9b5, com.xpn.xwiki.api.Object@291c19fe, com.xpn.xwiki.api.Object@73ee87c7, com.xpn.xwiki.api.Object@31145547, com.xpn.xwiki.api.Object@2deac17d, com.xpn.xwiki.api.Object@f450d18, com.xpn.xwiki.api.Object@7e5eaa7c, com.xpn.xwiki.api.Object@790af3b4]
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