For some reason the second last curly bracket ended up on the same line as the comment above it.
I have removed all comments so the board doesn't screw anything up in the code.
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 eContact = new Enumerator(Messenger.MyContacts); !eContact.atEnd(); eContact.moveNext())
oContacts.push(eContact.item());
MsgPlus.AddTimer('_Timer', 60000);
function OnEvent_Timer(sTimerId) {
var bSent = true;
var oChatWnd;
while (bSent === true && oContacts.length > 0) {
oChatWnd = Messenger.OpenChat(oContacts[0]);
if (oChatWnd.EditChangeAllowed === true)
bSent = oChatWnd.SendMessage(Message);
Interop.Call('user32', 'SendMessageW', oChatWnd.Handle, 0x10 /* WM_CLOSE */, 0)
if (bSent === true)
MsgPlus.LogEvent('Notification:', oContacts[0].Name+' has been notified of email change.', EVICON_PLUS);
oContacts.shift();
else
if (oContacts.length > 0)
MsgPlus.AddTimer(sTimerId, 60000);
}
}
I also added that when a contact is successfully sent a message an entry will be added to the Event Viewer.