What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » sending a message to all my contacts

sending a message to all my contacts
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: sending a message to all my contacts
Without testing...

Javascript code:
var oContacts = [];
var Message = 'This is where your message would go.';
 
function OnEvent_Initialize() {
    OnEvent_SigninReady();
}
 
function OnEvent_SigninReady() {
    if (Messenger.MyStatus < STATUS_INVISIBLE) return false;
   
    for (var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext())
        oContacts.push(e.item())
       
    MsgPlus.AddTimer('', 60000); // Run every minute
}
 
function OnEvent_Timer() {
    var bSent = true;
    var oChatWnd;
    while (bSent === true && oContacts.length > 0) {
        oChatWnd = Messenger.OpenChat(oContacts[0]);
        if (oChatWnd.EditChangeAllowed === true) // Can we send a message?
            bSent = oChatWnd.SendMessage(Message); // Store the result in a variable incase we've hit the flood protection
           
            Interop.Call('user32', 'SendMessageW', oChatWnd.Handle, 0x10 /* WM_CLOSE */, 0) // Close the window regardless
           
            if (bSent === true) // Was the message sent correctly?
                oContacts.shift(); // Drop the first element of the array
            else
                if (oContacts.length > 0)
                    MsgPlus.AddTimer('', 60000); // Run every minute
    }
}


This post was edited on 07-04-2012 at 02:20 PM by matty.
07-04-2012 02:19 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
sending a message to all my contacts - by gregrj on 07-04-2012 at 01:57 PM
RE: sending a message to all my contacts - by matty on 07-04-2012 at 02:19 PM
RE: sending a message to all my contacts - by gregrj on 07-04-2012 at 05:07 PM
RE: sending a message to all my contacts - by matty on 07-04-2012 at 05:13 PM
RE: sending a message to all my contacts - by gregrj on 07-05-2012 at 12:24 PM
RE: sending a message to all my contacts - by matty on 07-05-2012 at 12:42 PM
RE: sending a message to all my contacts - by gregrj on 07-05-2012 at 01:03 PM
RE: sending a message to all my contacts - by matty on 07-05-2012 at 03:26 PM
RE: sending a message to all my contacts - by gregrj on 07-05-2012 at 03:30 PM
RE: sending a message to all my contacts - by gregrj on 07-05-2012 at 03:34 PM
RE: sending a message to all my contacts - by matty on 07-05-2012 at 03:35 PM
RE: sending a message to all my contacts - by gregrj on 07-05-2012 at 10:55 PM
RE: sending a message to all my contacts - by gregrj on 07-06-2012 at 11:45 AM
RE: sending a message to all my contacts - by Mnjul on 07-06-2012 at 01:50 PM
RE: sending a message to all my contacts - by gregrj on 07-06-2012 at 10:11 PM
RE: sending a message to all my contacts - by gregrj on 07-09-2012 at 02:55 PM
RE: sending a message to all my contacts - by matty on 07-10-2012 at 12:24 PM
RE: sending a message to all my contacts - by segosa on 07-14-2012 at 09:26 AM


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