Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@67667f23
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@3c859a67, com.xpn.xwiki.api.Object@675bff3b, com.xpn.xwiki.api.Object@48d1af80, com.xpn.xwiki.api.Object@3e5921d9, com.xpn.xwiki.api.Object@4dbd4d89, com.xpn.xwiki.api.Object@472d853e, com.xpn.xwiki.api.Object@7d86cdf3, com.xpn.xwiki.api.Object@1d3b4ce7, com.xpn.xwiki.api.Object@2035e0af]
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