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

Help:
Author: Message:
Wakaki
Junior Member
**

Avatar

Posts: 30
31 / Male / –
Joined: Jan 2007
O.P. RE: RE: Help:
quote:
Originally posted by Mattike
You should set a variable (like PlusWnd) which gets the return value of MsgPlus.CreateWnd, like:
code:
var PlusWnd =  MsgPlus.CreateWnd( 'windows_new.xml', 'Polite', 0 );
Then, you get the line from the file:
code:
var filePath = MsgPlus.ScriptFilesPath + "\\myfile.txt";
var sLine = new ActiveXObject('Scripting.FileSystemObject').GetFile(filePath).OpenAsTextStream(1, -1).ReadLine();
Then, you set the value using SetControlText:
code:
PlusWnd.SetControlText("EdtWelcomeMsg", sLine);


thank you but it is still not clear how i should use that variable is it like this?
code:
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 filePath = MsgPlus.ScriptFilesPath + "\\myfile.txt";
var sLine = new ActiveXObject('Scripting.FileSystemObject').GetFile(filePath).OpenAsTextStream(1, -1).ReadLine();

var PlusWnd = MsgPlus.CreateWnd( 'windows_new.xml', 'Polite', 0 );
PlusWnd.SetControlText("EdtWelcomeMsg", sLine)
break;
}

}


i think actually not
but is it then like this
code:
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=MsgPlus.CreateWnd( 'windows_new.xml', 'Polite', 0 );

break;
}
function readfileandsetdefault()
{
         var filePath = MsgPlus.ScriptFilesPath + "\\myfile.txt";
          var sLine = new ActiveXObject('Scripting.FileSystemObject').GetFile(filePath).OpenAsTextStream(1, -1).ReadLine();

var PlusWnd = MsgPlus.CreateWnd( 'windows_new.xml', 'Polite', 0 );
PlusWnd.SetControlText("EdtWelcomeMsg", sLine)

}


}



This post was edited on 01-02-2007 at 05:30 PM by Wakaki.
[Image: wakakipt2.png]
01-02-2007 05:25 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help: - by Wakaki on 01-02-2007 at 01:57 PM
RE: Help: - by Spunky on 01-02-2007 at 03:30 PM
RE: Help: - by Wakaki on 01-02-2007 at 03:47 PM
RE: Help: - by Matti on 01-02-2007 at 04:06 PM
RE: RE: Help: - by Wakaki on 01-02-2007 at 05:25 PM
RE: Help: - by Spunky on 01-02-2007 at 05:40 PM
RE: Help: - by Wakaki on 01-02-2007 at 06:14 PM


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