What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » activex help

activex help
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: activex help
Use the FileSystemObject! :)
code:
Original from MPScripts.net
// Writes content over an existing text file (replace the current text with new text)
function OverwriteFile (file, content) {
  var fileObj = new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 2, 0);
  fileObj.Write(content);
  fileObj.Close();
}

Use that function to write the content, like:
code:
OverwriteFile("file1.txt", PlusWnd.GetControlText("EdtThing1");
OverwriteFile("file2.txt", PlusWnd.GetControlText("EdtThing2");

If you need a function to read the contents again:
code:
Original from MPScripts.net
// Reads the full contents of a text file to a variable
function ReadFile (file) {
  var fileObj = new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
  var contents = fileObj.ReadAll();
  fileObj.Close();
  return contents;
}

* Matti (L) the MP!L Script Developers Resource... thanks Dempsey!

This post was edited on 01-03-2007 at 05:11 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-03-2007 04:15 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
activex help - by Wakaki on 01-03-2007 at 10:58 AM
RE: activex help - by Matti on 01-03-2007 at 04:15 PM
RE: activex help - by Wakaki on 01-03-2007 at 04:40 PM
RE: activex help - by Matti on 01-03-2007 at 05:10 PM
RE: activex help - by Wakaki on 01-03-2007 at 05:21 PM
RE: activex help - by roflmao456 on 01-03-2007 at 11:28 PM
RE: activex help - by Wakaki on 01-04-2007 at 09:59 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