Shoutbox

Solved [Help] Can't get contacts from enumerator. - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Solved [Help] Can't get contacts from enumerator. (/showthread.php?tid=67888)

Solved [Help] Can't get contacts from enumerator. by Deco on 10-31-2006 at 02:35 AM

Hi guys

I'm trying to get contacts from a chatWnd using the Messenger.CurrentChats enumerator... but for some reason it doesn't work. If someone could take a look and maybe help here's the code.

code:
function SendsMyMessageToSomeone(Email,Message) {
    var Windows = Messenger.CurrentChats;
    var e = new Enumerator(Windows);
    for(; !e.atEnd(); e.moveNext()) {
        var myContacts = e.Contacts;
        var f = new Enumerator(myContacts);
        for(; !f.atEnd(); f.moveNext())    {
            var myContact = f.item();
            if(myContact.Email == Email)    {
                e.SendMessage(Message);
                }   
            }
          }
      }


This is the error I get:

Error: Object not a collection.
       Line: 26. Code: -2146827837.

Line 26 is: var f = new Enumerator(myContacts);


Thanks

edit: Solved by Plan. Thanks a lot.


RE: [Help] Can't get contacts from enumerator. by Plan-1130 on 10-31-2006 at 06:11 AM

at line 25:

code:
var myContacts = e.item().Contacts;
that should fix it :)