Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@45f9a7ce
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@65229f3c, com.xpn.xwiki.api.Object@44045003, com.xpn.xwiki.api.Object@772117d7, com.xpn.xwiki.api.Object@1da4615b, com.xpn.xwiki.api.Object@12f3ac91, com.xpn.xwiki.api.Object@3bc66d4f, com.xpn.xwiki.api.Object@60327c31, com.xpn.xwiki.api.Object@1277a64e, com.xpn.xwiki.api.Object@6d47545a]
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