What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Question] Strange error

[Question] Strange error
Author: Message:
tryxter
Junior Member
**

Avatar
A. Maia Ferreira @ PTnet

Posts: 51
Reputation: 1
35 / Male / –
Joined: Jan 2007
O.P. [Question] Strange error
code:
function OnEvent_Initialize(MessengerStart) {
    testing();
}

function testing() {
    var Shell = new ActiveXObject("WScript.Shell");
    Shell.Run(MsgPlus.ScriptFilesPath+"\\lol.txt");
}


executing this will return me an error:

code:
Script is starting
Script is now loaded and ready
Error: unknown.
       Line: 7. Code: -2147024894.
Function OnEvent_Initialize returned an error. Code: -214735256

I think everything is ok... The files exists, the path it's fine...
What should I do?
01-29-2007 10:08 PM
Profile E-Mail PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: [Question] Strange error
Try enclosing the path with quotation marks:
code:
function OnEvent_Initialize(MessengerStart) {
    testing();
}

function testing() {
    var Shell = new ActiveXObject("WScript.Shell");
    Shell.Run("\""+MsgPlus.ScriptFilesPath+"\\lol.txt"+"\"");
}
01-29-2007 11:48 PM
Profile PM Find Quote Report
tryxter
Junior Member
**

Avatar
A. Maia Ferreira @ PTnet

Posts: 51
Reputation: 1
35 / Male / –
Joined: Jan 2007
O.P. RE: [Question] Strange error
quote:
Originally posted by phalanxii
Try enclosing the path with quotation marks:
code:
function OnEvent_Initialize(MessengerStart) {
    testing();
}

function testing() {
    var Shell = new ActiveXObject("WScript.Shell");
    Shell.Run("\""+MsgPlus.ScriptFilesPath+"\\lol.txt"+"\"");
}


Worked! Great job, thanks a lot!
01-30-2007 12:09 AM
Profile E-Mail PM Find Quote Report
tryxter
Junior Member
**

Avatar
A. Maia Ferreira @ PTnet

Posts: 51
Reputation: 1
35 / Male / –
Joined: Jan 2007
O.P. RE: [Question] Strange error
Btw, I'm getting an error while using WScript.Sleep.

code:
var Shell = WScript.CreateObject("WScript.Shell");

function OnEvent_Initialize(MessengerStart) {
    Shell.sleep(100);
}

It returns the error:

code:
Error: 'WScript' is undefined.
       Line: 1. Code: -2146823279.

Am I supposed to define WScript?

This post was edited on 01-30-2007 at 12:11 PM by tryxter.
01-30-2007 12:02 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [Question] Strange error
quote:
Originally posted by tryxter
Am I supposed to define WScript?

Yes. For sleep you could also use
code:
Interop.Call("Kernel32", "Sleep", 100);
01-30-2007 12:10 PM
Profile E-Mail PM Web Find Quote Report
tryxter
Junior Member
**

Avatar
A. Maia Ferreira @ PTnet

Posts: 51
Reputation: 1
35 / Male / –
Joined: Jan 2007
O.P. RE: [Question] Strange error
But I can't use WScript on msgplus scripting?

I can't do something like this in JScript?

code:
WScript.Echo("Hello World");

This post was edited on 01-30-2007 at 12:15 PM by tryxter.
01-30-2007 12:13 PM
Profile E-Mail PM 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