This is right from the scripting documentation...
The only thing you need is a reference to a window and loop through it
code:
//Get the contacts of the conversation
var Contacts = ChatWnd.Contacts
//Start looping through all the contacts
//An Enumerator is an object which contains a list of the thing you pass to it
//Then 'moveNext' through the list while it's not at the end
for(var e = new Enumerator(Contacts); !e.atEnd(); e.moveNext())
{
//Then you get the current item from that list
var Contact = e.item()
//And print the Email, or whatever you want...
Debug.Trace(Contact.Email)
}