Shoutbox

save messages to .txt-file and upload it on the internet - but how? - 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: save messages to .txt-file and upload it on the internet - but how? (/showthread.php?tid=83372)

save messages to .txt-file and upload it on the internet - but how? by realEquinox on 04-24-2008 at 04:24 PM

Hi2all!

This is the first time i write in jscript so i don't know the syntax - but it's not that different from java so I hope I can make it:)

I read many tutorials about how2 create and write into a txt-file, but it doesn't work:S here's the code i used:

myFile = new File('C://test.txt');

I wanted to save the text written in my conversations in this txt-file, and then upload it to a ftp-server (there should also be a window were the user of the script can write in the server's address, password and username), so it would be possible to upload the "logs" if you are chating somewhere, and then download them at home.

For the upload I used the script I found in the documentation - but still it's not working:S

function OnEvent_ChatWndCreated(ChatWnd)
{
    myFile = new File('C://test.txt');
   
    var Started = MsgPlus.UploadFileFTP("C:/Setup.log", "ftp://username.awardspace.com/", "username", "password", "test.txt");
    if(Started)
        Debug.Trace("Uploading file, waiting for event");
    else   
        Debug.Trace("Couldn't start the upload");
}

function OnEvent_UploadFileComplete(Server, Destination, Source, Success)
{
    Debug.Trace("UploadFileComplete event received for " + Destination);
    Debug.Trace("   Success: " + Success);
}

Sorry 4 my bad english:S - thx 4 your answers:)


RE: save messages to .txt-file and upload it on the internet - but how? by matty on 04-24-2008 at 04:27 PM

http://msdn2.microsoft.com/en-us/library/z9ty6h50(VS.85).aspx


RE: save messages to .txt-file and upload it on the internet - but how? by realEquinox on 04-25-2008 at 02:01 PM

ok, thx for your answer matty:)

but maybe there would be a better solution:

i upload the logs which are made by the msn-messenger automatically, so I don't have 2 make them myself.

the problem:
how can I get the path of those logs?
e.g., this is the path of one of my logs: D:\realEquinox\Aufzeichnungen\April 2008\real_equinox@hotmail.de

but if someone else wants 2 use my script, he can't, because the path is different:S

any ideas how it's possible 2 find it?


RE: save messages to .txt-file and upload it on the internet - but how? by roflmao456 on 04-27-2008 at 05:46 PM

code:
var logs = "D:\\realEquinox\\Aufzeichnungen\\April 2008\\" + Messenger.MyEmail;
var fso = new ActiveXObject("Scripting.FileSystemObject");
if(fso.DirectoryExists(logs)){
Debug.Trace("log folder exists");
} else {
Debug.Trace("log folder doesn't exist");
}


RE: save messages to .txt-file and upload it on the internet - but how? by realEquinox on 04-27-2008 at 07:42 PM

Thx, but that would only work on my PC.
Other users will still have a problem, because their path will be: C:\\username\\Aufzeichnungen\\month year\\" + Messenger.MyEmail; and not D:\\realEquinox\\foldername\\April 2008\\" + Messenger.MyEmail; :S

so how can the script find it? is there a search-function or something like that?


RE: save messages to .txt-file and upload it on the internet - but how? by CookieRevised on 06-30-2008 at 07:37 PM

No, a search function wont be any good.

You need to read the registry settings of Plus!. From these settings you can build the proper and complete path:

HKCU\Software\Patchou\Messenger Plus! Live\your@email.com
LogsDirectory, LogsInDateDir, LogsDateDirFormat

You also need to read the user's local translations and abbreviations for date names like months and days. For this you need to use some Windows APIs like GetLocaleInfo or GetDateFormat.

http://www.msgpluslive.net/help/registry/
http://www.msdn.com/