What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » headache: Special characters.

headache: Special characters.
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: headache: Special characters.
Oops matty made a mistake of his own...

code:
function OnEvent_Initialize(MessengerStart){
    //loop through the contacts
    for (var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext()){
        // write the contacts name to the file test.txt in the scripts path
        AddLineToFile ('test.txt', e.item().Name);
    }
}

function AddLineToFile (file, line) {
    // declare fsObj has FilesystemObject
    var fsObj = new ActiveXObject('Scripting.FileSystemObject');
    //check if the file exists already
    var fileexists = fsObj.FileExists(MsgPlus.ScriptFilesPath + '\\' + file);
    //open the file
    var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, (fileexists ? 8 : 2 /* Previously was set to 1 which is ForReading */), true, (-1) /* UNICODE */);
    //try to write the name to the file
    try { fileObj.WriteLine(line); }
    catch (err) {
        //Oops we have an error lets output the name and the error
        Debug.Trace(line);
        Debug.Trace(err.description);
    }
    //close the file
    fileObj.Close();
    //unset the fsObj
    fsObj = null;
}


This post was edited on 07-23-2007 at 04:29 PM by matty.
07-23-2007 03:56 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
headache: Special characters. - by runarius on 07-23-2007 at 10:29 AM
RE: headache: Special characters. - by davidpolitis on 07-23-2007 at 10:47 AM
RE: headache: Special characters. - by runarius on 07-23-2007 at 10:49 AM
RE: RE: headache: Special characters. - by davidpolitis on 07-23-2007 at 10:51 AM
RE: headache: Special characters. - by runarius on 07-23-2007 at 11:03 AM
RE: RE: headache: Special characters. - by davidpolitis on 07-23-2007 at 11:05 AM
RE: headache: Special characters. - by runarius on 07-23-2007 at 11:09 AM
RE: headache: Special characters. - by davidpolitis on 07-23-2007 at 11:10 AM
RE: headache: Special characters. - by runarius on 07-23-2007 at 11:11 AM
RE: headache: Special characters. - by davidpolitis on 07-23-2007 at 11:12 AM
RE: headache: Special characters. - by runarius on 07-23-2007 at 11:26 AM
RE: headache: Special characters. - by davidpolitis on 07-23-2007 at 11:42 AM
RE: headache: Special characters. - by Deco on 07-23-2007 at 01:40 PM
RE: headache: Special characters. - by matty on 07-23-2007 at 01:44 PM
RE: headache: Special characters. - by runarius on 07-23-2007 at 02:37 PM
RE: headache: Special characters. - by MeEtc on 07-23-2007 at 02:44 PM
RE: headache: Special characters. - by runarius on 07-23-2007 at 02:57 PM
RE: headache: Special characters. - by matty on 07-23-2007 at 03:56 PM
RE: headache: Special characters. - by runarius on 07-23-2007 at 04:18 PM
RE: headache: Special characters. - by Voldemort on 07-23-2007 at 04:21 PM
RE: headache: Special characters. - by matty on 07-23-2007 at 04:30 PM
RE: headache: Special characters. - by davidpolitis on 07-25-2007 at 06:33 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