Shoutbox

How to include a .log file in my personal message? - 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: How to include a .log file in my personal message? (/showthread.php?tid=90748)

How to include a .log file in my personal message? by msnplusfreak on 05-22-2009 at 06:14 PM

Hello,

Does someone know how I can include a .log file (on my computer or on the internet, preferably on my computer) in my Personal Message?


Greetz
  Messenger Plus Freak


RE: How to include a .log file in my personal message? by matty on 05-22-2009 at 07:15 PM

How long would this .log file be? Personal messages are limited to 255 characters I think it is.


RE: How to include a .log file in my personal message? by msnplusfreak on 05-22-2009 at 07:17 PM

No more than 70 characters...


RE: How to include a .log file in my personal message? by matty on 05-22-2009 at 07:20 PM

You can use FileSystemObject to read the file then set the text to Messenger.MyPersonalMessage

js code:
try { Messenger.MyPersonalMessage = GetEverything('c:\\test.log'); } catch (e) {}

function GetEverything(sFile) {
   var fso;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   return fso.OpenTextFile(sFile, 1 /* ForReading */).ReadAll();
}

RE: How to include a .log file in my personal message? by msnplusfreak on 05-22-2009 at 07:41 PM

Regrettably, Nothing Happens in my personal message...


RE: How to include a .log file in my personal message? by matty on 05-22-2009 at 07:47 PM

js code:
function OnEvent_Initialize() {
    if (Messenger.MyStatus < STATUS_INVISIBLE ) return;
    Messenger.MyPersonalMessage = ReadFile('c:\\test.log');
}

function OnEvent_SigninReady() {  OnEvent_Initialize(); }

function ReadFile(sFile) {
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    return fso.OpenTextFile(sFile, 1 /* ForReading */).ReadAll();
}

Something like this should work. It should have worked before oh well.
RE: How to include a .log file in my personal message? by msnplusfreak on 05-22-2009 at 07:56 PM

Nothing happens, maybe you can give "Remote Assistance" with MSN?
I'll add you on my messenger, Can I get your email adress?

Or maybe you can give me the .plsc file?

Greetzzz


RE: How to include a .log file in my personal message? by matty on 05-25-2009 at 11:51 AM

Did you replace the the path of C:\\test.log with a valid file that you are wanting to read?


RE: How to include a .log file in my personal message? by msnplusfreak on 05-29-2009 at 05:14 PM

Yes, I replaced that...


RE: How to include a .log file in my personal message? by matty on 05-29-2009 at 06:12 PM

Post the code and the file as well please.


RE: How to include a .log file in my personal message? by msnplusfreak on 05-31-2009 at 08:59 PM

code:
function OnEvent_Initialize() {
    if (Messenger.MyStatus < STATUS_INVISIBLE ) return;
    Messenger.MyPersonalMessage = ReadFile('C:\Users\Myname\Desktop\test.log');
}

function OnEvent_SigninReady() {  OnEvent_Initialize(); }

function ReadFile(sFile) {
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    return fso.OpenTextFile(sFile, 1 /* ForReading */).ReadAll();
}

RE: How to include a .log file in my personal message? by CookieRevised on 05-31-2009 at 09:22 PM

Notice that the file and path name in matty's code has double slashes, it is mandatory:

js code:
Messenger.MyPersonalMessage = ReadFile('c:\\test.log');


So change
code:
ReadFile('C:\Users\Myname\Desktop\test.log');
to
js code:
ReadFile('C:\\Users\\Myname\\Desktop\\test.log');

RE: How to include a .log file in my personal message? by msnplusfreak on 06-01-2009 at 05:11 PM

Ok, many thanks!!

It works, but when the log file changes, it must also change in my personal message...

Greetz
Messenger Plus Freak

quote:
P.S. : Can the script read also PHP files on the internet?