What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » help (debug this script - syntax error)

Pages: (2): « First [ 1 ] 2 » Last »
help (debug this script - syntax error)
Author: Message:
Wakaki
Junior Member
**

Avatar

Posts: 30
31 / Male / –
Joined: Jan 2007
O.P. help (debug this script - syntax error)
this is my 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 OnWindowidEvent_CtrlClicked(PlusWnd, CtrlId) {
if(CtrlId == "BtnSave") {
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 doesnt work in the debugging screen it says that in line 53 ')' was expected
line 53 is (almost) the same as line 54
so i think the error is in both

line 53 and 54:
code:
OverwriteFile("defwelcomemsg.txt", PlusWnd.GetControlText("EdtWelcomeMSg");
OverwriteFile("defgoodbyemsg.txt", PlusWnd.GetControlText("EdtGoodbyeMsg");


This post was edited on 01-04-2007 at 06:34 PM by WDZ.
[Image: wakakipt2.png]
01-04-2007 02:56 PM
Profile PM Find Quote Report
ins4ne
Veteran Member
*****

Avatar
...

Posts: 1015
Reputation: 38
37 / Male / Flag
Joined: Apr 2006
Status: Away
RE: help
quote:
Originally posted by Wakaki
code:
OverwriteFile("defwelcomemsg.txt", PlusWnd.GetControlText("EdtWelcomeMSg");
OverwriteFile("defgoodbyemsg.txt", PlusWnd.GetControlText("EdtGoodbyeMsg");


Make it
code:
OverwriteFile("defwelcomemsg.txt", PlusWnd.GetControlText("EdtWelcomeMSg"));
OverwriteFile("defgoodbyemsg.txt", PlusWnd.GetControlText("EdtGoodbyeMsg"));

I don't know if it's right but it seems logical to me...

This post was edited on 01-04-2007 at 03:03 PM by ins4ne.
[Image: b5c5bb366c94ba43283cc13901380e3e.png]
01-04-2007 03:02 PM
Profile PM Find Quote Report
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
RE: help
The debugger tells you exactly what is wrong.

You need to add another bracket :P
code:
OverwriteFile("defwelcomemsg.txt", PlusWnd.GetControlText("EdtWelcomeMSg"));
OverwriteFile("defgoodbyemsg.txt", PlusWnd.GetControlText("EdtGoodbyeMsg"));
01-04-2007 03:03 PM
Profile PM Find Quote Report
Wakaki
Junior Member
**

Avatar

Posts: 30
31 / Male / –
Joined: Jan 2007
O.P. RE: help
thank you both i will try it out now
but the save button doesn't work:(

if is press on iyt it does nothing

This post was edited on 01-04-2007 at 03:28 PM by Wakaki.
[Image: wakakipt2.png]
01-04-2007 03:26 PM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: help
check the instance name is the same in the XML file and the script (eg. BtnSave)

[offtopic]
This is at least the third thread you have made for this script and all the problems seem to be related. Can you please stick to one thread?
[/offtopic]
<Eljay> "Problems encountered: shit blew up" :zippy:
01-04-2007 04:03 PM
Profile PM Find Quote Report
Wakaki
Junior Member
**

Avatar

Posts: 30
31 / Male / –
Joined: Jan 2007
O.P. RE: help
alright

but how do you say that when he clicks that button at the ned he must close the window?
[Image: wakakipt2.png]
01-04-2007 04:56 PM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: help
quote:
Originally posted by Wakaki
alright

but how do you say that when he clicks that button at the ned he must close the window?

code:
PlusWnd.Close(x);


x can equal any number, it's up to you what it is... it's not important in this case I think
<Eljay> "Problems encountered: shit blew up" :zippy:
01-04-2007 05:16 PM
Profile PM Find Quote Report
Wakaki
Junior Member
**

Avatar

Posts: 30
31 / Male / –
Joined: Jan 2007
O.P. RE: help (debug this script - syntax error)
it doesn't work when i press the button nothing happens i checked the button names
[Image: wakakipt2.png]
01-06-2007 10:21 AM
Profile PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: help (debug this script - syntax error)
thats because:
code:
function OnWindowidEvent_CtrlClicked(PlusWnd, CtrlId) {
Windowid needs to be the actual window id...


i hope this helps
01-06-2007 10:23 AM
Profile PM Find Quote Report
Wakaki
Junior Member
**

Avatar

Posts: 30
31 / Male / –
Joined: Jan 2007
O.P. RE: help (debug this script - syntax error)
silly me thanks nanafreak but now i want to make a checkbox and if its on the script works and els it doesn't so how do you make a checkbox in xml?
[Image: wakakipt2.png]
01-06-2007 02:40 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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