Well, I prefer doing my MM scripting in JScript. One thing I was missing is the MessageBox function. The problem was that MessageBox want a VBSArray (Associative Array) as argument which cannot be supplied by JScript.
Here's my solution:
function JS2VBArray( objJSArray )
{
var dictionary = new ActiveXObject( "Scripting.Dictionary" );
for ( var i = 0; i < objJSArray.length; i++ )
{
dictionary.add( i, objJSArray[ i ] );
}
return dictionary.Items();
}
SDB.MessageBox("Wow! JScript Message", 2, JS2VBArray( new Array(4) ));
MessageBox in jscript
Moderators: Gurus, Addon Administrators
-
Guest
Re: MessageBox in jscript
Sorry, a small fix:stoffel wrote:Well, I prefer doing my MM scripting in JScript. One thing I was missing is the MessageBox function. The problem was that MessageBox want a VBSArray (Associative Array) as argument which cannot be supplied by JScript.
Here's my solution:
function JS2VBArray( objJSArray )
{
var dictionary = new ActiveXObject( "Scripting.Dictionary" );
for ( var i = 0; i < objJSArray.length; i++ )
{
dictionary.add( i, objJSArray[ i ] );
}
return dictionary.Items();
}
SDB.MessageBox("Wow! JScript Message", 2, JS2VBArray( new Array(4) ));
SDB.MessageBox("Wow! JScript Message", 2, JS2VBArray(new Array(mbOk.toString())));
works better