You can't do that directly, as there is no "Email" parameter in OnEvent_ChatWndReceiveMessage(); This is where
loops come in:
JScript code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind) {
if(Origin !== Messenger.MyName) {
for(var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
Debug.Trace(e.item().Email); // Displays the WlID of the current contact
}
}
}
This is a for loop. It works like this:
for(
Initial variable(s);
Testing condition;
Increment) {
Code
}
- Initial variable(s): this is what you have at the beginning, so an enumerator, array or whatsoever
- Testing condition: if, and only if the testing condition is true, the Code will be executed
- Increment: after the code has been executed, the Increment part is executed. If the Testing condition is false, this will not e executed