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

Script Help....
Author: Message:
nokturnal
New Member
*

Avatar

Posts: 4
– / Male / –
Joined: Jul 2006
O.P. Script Help....
Hey guys,

First off I have to apologize for this stupid question and I hope I don't get yelled at too badly, but I just can't get it working.

I am attempting to do the 'Window Test' tutorial in the scripting documentation and can't seem to get the CreateWnd method to work.

Here is the code:

Window Test.js
code:
function OnEvent_Initialize(MessengerStart) {
    var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}

InterfaceTest.xml
code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Window Id="WndTest" Version="1">
        <Attributes>
            <Caption>Test Window</Caption>
        </Attributes>
        <TitleBar>
            <Title>
                <Text>Hello!</Text>
            </Title>
        </TitleBar>
        <Position Width="180" Height="75"/>
        <DialogTmpl/>
        <Controls>
            <Control xsi:type="StaticControl" Id="LblTop">
                <Position Left="10" Top="10" Width="150"/>
                <Caption>Hello world!</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="BtnClose">
                <Position Left="112" Top="25" Width="50"/>
                <Caption>Close</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>


The files are in the same directory inside c:/../../Messenger Plus! Live/Scripts/Window Test/

Debug window says:

Script is starting
Script is now loaded and ready
Function called: OnEvent_Initialize

... and no window :)

I have MessengerPlus! Live 4.0.0.235 with MSN 8.0.0792.00

Any idea's?
07-05-2006 08:42 PM
Profile E-Mail PM Web Find Quote Report
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
RE: Script Help....
When creating the XML, make sure it is saved in unicode.
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
07-05-2006 08:48 PM
Profile PM Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: Script Help....
Hmm, try this. Open your xml file in wordpad and save it as a unicode xml file.
07-05-2006 08:48 PM
Profile E-Mail PM Web Find Quote Report
NiteMare
Veteran Member
*****

Avatar
Giga-Byte me

Posts: 2497
Reputation: 37
37 / Male / Flag
Joined: Aug 2003
RE: Script Help....
is the xml file saved as unicode?, i had the same problem and that fixed it
[Image: sig/]
I'll never forget what she said 6860 days, 20 hours, 2 minutes, 39 seconds ago
Need hosting? Check
out my website. we can help you out :)
07-05-2006 08:50 PM
Profile PM Web Find Quote Report
BstrdSmkr
Junior Member
**

Avatar
Earned. Never Given.

Posts: 46
39 / Male / –
Joined: Jul 2006
RE: Script Help....
I could be wrong here, but try dropping the "var Wnd= " part.  such as:
code:
function OnEvent_Initialize(MessengerStart)
{
     MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}

07-05-2006 08:51 PM
Profile E-Mail PM Web Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
39 / Male / Flag
Joined: Aug 2004
Status: Away
RE: Script Help....
You shouldn't create windows in the Initialize event, unless you're already connected. Try doing it on sign in, or verify the current status and the MessengerStart variable.

From the script documentation:
quote:
Scripts should keep their initialization to a strict minimum when MessengerStart is true. No window must be displayed at that time and no time consuming task must be launched.

This post was edited on 07-05-2006 at 09:02 PM by L. Coyote.

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

07-05-2006 09:00 PM
Profile PM Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: Script Help....
u have to save the xml in unicode 16...
unicode 8 won't work either...
07-05-2006 09:13 PM
Profile E-Mail PM Find Quote Report
nokturnal
New Member
*

Avatar

Posts: 4
– / Male / –
Joined: Jul 2006
O.P. RE: Script Help....
You guys are amazing!

There was a combination of problems I think.  Textpad must have been saving out unicode 8.  After I recreated the file in Wordpad and saved out it out in unicode everything worked.

I also moved the handling of the window creation out of the init event and into OnEvent_MyStatusChange.

The window test tutorial should be changed to reflect Leonardo's observation about not creating windows inside the init event unless you handle MessengerStart.

Thanks again guys!  And if i ever to create something worthwhile I will be sure to post it :)

Cheers
07-05-2006 09:21 PM
Profile E-Mail PM Web 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