What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » save messages to .txt-file and upload it on the internet - but how?

save messages to .txt-file and upload it on the internet - but how?
Author: Message:
realEquinox
New Member
*


Posts: 3
Joined: Apr 2008
O.P. Undecided  save messages to .txt-file and upload it on the internet - but how?
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:)

This post was edited on 04-24-2008 at 04:27 PM by realEquinox.
04-24-2008 04:24 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: save messages to .txt-file and upload it on the internet - but how?
http://msdn2.microsoft.com/en-us/library/z9ty6h50(VS.85).aspx
04-24-2008 04:27 PM
Profile E-Mail PM Find Quote Report
realEquinox
New Member
*


Posts: 3
Joined: Apr 2008
O.P. RE: save messages to .txt-file and upload it on the internet - but how?
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?
04-25-2008 02:01 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: save messages to .txt-file and upload it on the internet - but how?
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");
}

[quote]
Ultimatess6
: What a noob mod
04-27-2008 05:46 PM
Profile PM Web Find Quote Report
realEquinox
New Member
*


Posts: 3
Joined: Apr 2008
O.P. RE: save messages to .txt-file and upload it on the internet - but how?
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?

This post was edited on 04-28-2008 at 08:49 AM by realEquinox.
04-27-2008 07:42 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: save messages to .txt-file and upload it on the internet - but how?
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/

This post was edited on 06-30-2008 at 07:38 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-30-2008 07:37 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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