Wakaki
Junior Member
Posts: 30
31 / / –
Joined: Jan 2007
|
O.P. what is wrong with this script?
code: //global variables:
var fsObj = new ActiveXObject("Scripting.FileSystemObject");
var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\defwelcomemsg.txt', 1);
var DefWelcomemsg = fileObj.ReadAll();
fileObj.Close();
var fsObj2 = new ActiveXObject("Scripting.FileSystemObject");
var fileObj2 = fsObj2.OpenTextFile(MsgPlus.ScriptFilesPath + '\\defgoodbyemsg.txt', 1);
var DefGoodbyemsg = fileObj2.ReadAll();
fileObj2.Close();
//functions
function OnEvent_Initialize(MessengerStart)
{
}
function OnGetScriptMenu(Location)
{
var ScriptMenu ="<ScriptMenu>";
ScriptMenu +="<MenuEntry Id=\"window\">Polite Preferences</MenuEntry>";
ScriptMenu +="</ScriptMenu>";
return ScriptMenu;
}
function OnEvent_MenuClicked(MenuId, Location, Wnd)
{
switch(MenuId)
{
case "window":
var PlusWnd = MsgPlus.CreateWnd( 'windows_new.xml', 'Polite', 0 );
PlusWnd.SetControlText("EdtWelcomeMsg", DefWelcomemsg)
PlusWnd.SetControlText("EdtGoodbyeMsg", DefGoodbyemsg)
break;
}
}
function OverwriteFile (file, content)
{
var fileObj4 = new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 2, 0);
fileObj4.Write(content);
fileObj4.Close();
}
function OnPoliteEvent_CtrlClicked(PlusWnd, CtrlId) {
if(CtrlId == "Btnlol") {
OverwriteFile("defwelcomemsg.txt", PlusWnd.GetControlText("EdtWelcomeMSg"));
OverwriteFile("defgoodbyemsg.txt", PlusWnd.GetControlText("EdtGoodbyeMsg"));
}
}
function OnEvent_Signin(Email)
{
var Message = DefWelcomemsg;
MsgPlus.DisplayToast("Hello", Message);
}
function OnEvent_Signout(Email)
{
var Message = DefGoodbyemsg;
MsgPlus.DisplayToast("Goodbye", Message);
}
function OnEvent_Uninitialize(MessengerExit)
{
}
it doesn;t work
|
|