What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Get Contacts in a chat

Get Contacts in a chat
Author: Message:
Scripty
New Member
*


Posts: 4
Joined: May 2008
O.P. Undecided  Get Contacts in a chat
Hi
I am trying to get the name of a contact who I am trying to start a conversation with or who is trying to start a new conversation with me. So I added code to the function OnEvent_ChatWndCreated(ChatWnd) event
I am new to scripting so can anyone please provide me with a code snippet. I have written this

function OnEvent_ChatWndCreated(ChatWnd)
{
    m = ChatWnd.Contacts[1];
    alert(m.Name);
   
}

but it says

Script is starting
Script is now loaded and ready
Function called: OnEvent_Initialize
Function called: OnEvent_ChatWndCreated
Error: 'm.Name' is null or not an object (code: -2146823281)
       File: warn.js. Line: 13.
Function OnEvent_ChatWndCreated returned an error. Code: -2147352567

Thanks
05-15-2008 06:39 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: Get Contacts in a chat
well you need to set up an Enumerator and iterate through the contact objects

code:
function OnEvent_ChatWndCreated(ChatWnd){
for(var e = new Enumerator(ChatWnd.Contacts);!e.atEnd();e.moveNext()){
    Debug.Trace(e.item().Name);
    }
}

that will list all the names of the contacts in the conversation window (prints to the debugging window btw)


edit: if you look in the Scripting Documentation there is an example that is similar to this, except it lists the emails of the whole contact list. (uses same method)

This post was edited on 05-15-2008 at 07:34 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
05-15-2008 07:33 PM
Profile PM Web Find Quote Report
Scripty
New Member
*


Posts: 4
Joined: May 2008
O.P. RE: Get Contacts in a chat
Thank :)
05-15-2008 07:50 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On