Shoutbox

Fast way to add multiple contacts - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Skype & Live Messenger (/forumdisplay.php?fid=10)
+----- Thread: Fast way to add multiple contacts (/showthread.php?tid=63210)

Fast way to add multiple contacts by alegator on 07-13-2006 at 11:01 PM

I have a list of hotmail addresses in a txt file. Is there a way to add all of them to MSN at once? Or do I have to add them one by one? Thanks


RE: Fast way to add multiple contacts by Jimcando on 07-13-2006 at 11:27 PM

I don't know of any program that can do it, but there might be one out there...

One thing you can do is open notepad, type this in:

code:
<?xml version="1.0"?>
<messenger>
  <service name=".NET Messenger Service">
    <contactlist>
      <contact type="1">1st contact email address</contact>
      <contact type="1">2nd contact email address</contact>
      <contact type="1">etc....</contact>
    </contactlist>
  </service>
</messenger>


But insert your contacts names in. You'd have to do it for all your contacts aswell :(

Then go to Save As... (and make sure it saves it as 'All File Types') then save it as contacts.ctt

Then go to your contact list select Contacts - Import Instant Messaging Contacts... and open contacts.ctt.

It should work, but theres probably a much simpler and quicker way out there, so you might wanna wait a little while incase someone posts and easier way :D
RE: Fast way to add multiple contacts by alegator on 07-14-2006 at 12:23 AM

thanks Joey, I thought about that...same format that MSN uses to backup the contact list


RE: Fast way to add multiple contacts by Jimcando on 07-14-2006 at 12:24 AM

Yeh, exactly (Y)


RE: Fast way to add multiple contacts by AberNStein on 07-14-2006 at 12:59 AM

i knocked up a quick little jscript to do it. i couldn't figure out how to read the number of lines in a file, so you'll have to input that too.

code:
var fso, f1, ts, final;
fso = new ActiveXObject("Scripting.FileSystemObject");
var ForReading = 1;

function MakeCList(theFile,theNewFile,numContacts)
{
var final = '<?xml version="1.0"?>';
final += '<messenger>';
final += '<service name=".NET Messenger Service">';
final += '<contactlist>';
ts = fso.OpenTextFile(theFile, ForReading);
for (i=0; i<numContacts; i++)
{
final+='<contact type="1">' + ts.ReadLine() + '</contact>';
}
ts.Close();
final += '</contactlist>';
final += '</service>';
final += '</messenger>';
f1 = fso.CreateTextFile(theNewFile, true);
f1.Write (final);
f1.Close();
}

MakeCList("C:\\contacts.txt","C:\\contacts.ctt",10);

the syntax is MakeCList("[path to file with email addresses]","[path to new contacts.ctt]", [number of email addresses]);

obviously this assumes one email address per line. if they were comma seperated it would be really easy.

edit:
code:
var fso, f1, ts, final, a;
fso = new ActiveXObject("Scripting.FileSystemObject");
var ForReading = 1;

function MakeCList(theFile,theNewFile)
{
var final = '<?xml version="1.0"?>';
final += '<messenger>';
final += '<service name=".NET Messenger Service">';
final += '<contactlist>';
ts = fso.OpenTextFile(theFile, ForReading);
a=ts.ReadAll().split(",");
for (i=0; i<a.length; i++)
{
a[i]=a[i].replace(" ","");
final+='<contact type="1">' + a[i] + '</contact>';
}
ts.Close();
final += '</contactlist>';
final += '</service>';
final += '</messenger>';
f1 = fso.CreateTextFile(theNewFile, true);
f1.Write (final);
f1.Close();
}

MakeCList("C:\\contacts.txt","C:\\contacts.ctt");

that's for comma separated or comma space separated. doesn't need to know the number of addresses.
RE: Fast way to add multiple contacts by alegator on 07-14-2006 at 01:05 AM

Aber, can you tell me how to execute the jscript? Thanks


RE: Fast way to add multiple contacts by AberNStein on 07-14-2006 at 01:14 AM

copy it into notepad and save as blah.js
then run it.
change the last line to have the right files.


RE: Fast way to add multiple contacts by alegator on 07-14-2006 at 02:32 AM

thanks Aber


RE: RE: Fast way to add multiple contacts by AberNStein on 07-14-2006 at 03:12 AM

quote:
Originally posted by alegator
thanks Aber

no problem.
i'm getting back into programming, and i need the practise.