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
the MP!L Script Developers Resource... thanks Dempsey!