Shoutbox

Getting all my contacts - 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: Getting all my contacts (/showthread.php?tid=94554)

Getting all my contacts by Riko15 on 05-09-2010 at 12:40 PM

Hi,

I'm just new, and started with scripting Plus! yesterday.
I'm kinda stuck on something..

How can I show in my Debug window, who all my contacts emails are?
Thnx!

- If possible, I want the contacts to be seperated by comma's. -


RE: Getting all my contacts by Riko15 on 05-09-2010 at 06:45 PM

Nobody? o,o


RE: Getting all my contacts by whiz on 05-09-2010 at 06:48 PM

You need to enumerate the contact list like this.

js code:
var enum = new Enumerator(Messenger.MyContacts);
var contacts = new Array();
for (; !enum.atEnd(); enum.moveNext())
{
    contacts.push(enum.item().Email);
}
Debug.Trace(contacts.join(", "));

RE: Getting all my contacts by Spunky on 05-09-2010 at 07:13 PM

You don't need to use the join method on the array as tracing it will output a comma separated list of values...

js code:
var contacts = new Array();
for (var enum = new Enumerator(Messenger.MyContacts); !enum.atEnd(); enum.moveNext()){
    contacts.push(enum.item().Email);
}
Debug.Trace(contacts);

EDIT: Riko15, this is not a chat room or an instant messaging service. As such people may take a while to reply. Please have a little more patience.