Like I said it is a memory intensive task. I would recommend doing something like this:
js code:
// create an array to hold the contact objects
var objContacts = new Array();
function OnEvent_Initialize ( ) {
// verify user is logged on before doing anything
if ( Messenger.MyStatus < STATUS_INVISIBLE ) return;
// enumerate all contacts on the list
for ( var oContact = new Enumerator ( Messenger.MyContacts ); !oContact.atEnd ( ); oContact.moveNext ( ) ) {
// save all contacts to an array
objContacts.push ( oContact.item ( ) );
}
// create a timer to open the contacts
MsgPlus.AddTimer ( 'OpenContacts' , 250 );
}
function OnEvent_SigninReady ( ) {
OnEvent_Initialize ( );
}
function OnEvent_Timer ( sTimer ) {
// open the chat window for the contact and remove them from the array
// The shift() method is used to remove and return the first element of an array.
Messenger.OpenChat ( objContacts.shift ( ) );
// check if there are any more contacts left to open chat windows for if so keep the timer going
if ( objContacts.length > 0 ) MsgPlus.AddTimer ( sTimer , 250 );
}