Automatically called scripts can't be JScript

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Automatically called scripts can't be JScript

by trixmoto » Fri Sep 29, 2006 10:46 am

Scripting support at all is certainly fantastic - it's one of the main reasons I use MediaMonkey.

I like the fact that most people use VBScript, as it makes sharing script easier. However, I do believe that people should be given the choice, as not everyone is prepared to learn VBScript, especially if they already know JScript.

by DanielWebb » Fri Sep 29, 2006 9:17 am

The more languages the merrier as far as I'm concerned. Choice is good. Big respect to the MediaMonkey coders for implementing scripting at all.

I'm just hoping that this is a fairly trivial one to fix.

by Steegy » Fri Sep 29, 2006 7:46 am

MM uses the Microsoft Scripting Host, which is able to run VBScript and JScript. I just think that the devs didn't implement the JScript part 100% ok.

BTW: I was only talking about VBScript & JScript. I know that other languages (c, c++, java, php, c#, ...) are more powerful and "following the consistency standards". But I (with emphasis on I) haven't yet come across a script in JScript that couldn't be converted to VBScript. Microsoft tends to give VBScript a little bit more support, because it's "their" language, so sometimes VBScript can do things that are less easy in JScript (but usually it's possible).

Anyway you're right, and I back your request to fix the JScript support.

by drichm » Fri Sep 29, 2006 1:37 am

Steegy wrote:VBScript is virtually the same as JScript. Only differences are Sub->function, {}, casing, built-in functions, ... but basicly the same functionality is present.
I could not disagree more!!!!

I have programmed both plus others and I can quite categorically state that VB is by far the worst of the lot (with the possible exception of Perl).

I have also requested JavaScript/JScript support before. In fact, could all other ActiveX/OLE/... supporting script languages (e.g. Python) also be supported?

Dave

P.S. Is the problem adding the SDB object to the scripting namespace?

by Steegy » Thu Sep 28, 2006 7:21 pm

Code: Select all

... and VBScript sucks the creativity out of me
Why? VBScript is virtually the same as JScript. Only differences are Sub->function, {}, casing, built-in functions, ... but basicly the same functionality is present.

by Lowlander » Thu Sep 28, 2006 12:04 pm

Standarization of code sintaxis accross languages would be a good thing for all of us.

by trixmoto » Thu Sep 28, 2006 9:55 am

It took me a LONG time to get used to putting "End If" with the space in it after If statements. But this is more because I am a Uniface developer by trade and in Uniface you end an "if" with "endif". All these languages - it's sooooo confusing! :-? :lol:

by Lowlander » Thu Sep 28, 2006 9:08 am

So you admit that VBScript is better as you have less code (no semicolon) :wink: .

by trixmoto » Thu Sep 28, 2006 7:22 am

It would be nice if this was fixed. I learnt VBScript solely for the purpose of MM scripting, because I couldn't get JScript to work properly.

I often have to go through my VBScripts after I've finished coding a chunk and take all the semi-colons off the end of each line! :lol:

Automatically called scripts can't be JScript

by DanielWebb » Thu Sep 28, 2006 5:43 am

As discussed in a previous post we can't use JScript to code scripts in the auto folder.

To Reproduce:

create a file called, say, testJScript.js in the MediaMonkey/scripts/auto folder and past the following code into it:

Code: Select all

function OnStartup()
{
	var UI = SDB.UI;
	var Mnu = UI.AddMenuItem( UI.Menu_TrayIcon, -1, 1);
	Mnu.Caption = "TestJScript";
	Mnu.UseScript = Script.ScriptPath;
	Mnu.OnClickFunc = "ShowIt";
	Mnu.IconIndex = 35;
}

function ShowIt()
{
	SDB.MessageBox(SDB.Localize("ShowIt function called correctly."), mtError, mbOk);
}
Restart MediaMonkey, right click on the mediamonkey tray icon and select the new "TestJScript" menu item.

Error reported is:

"Error #1032 - Microsoft VBScript compilation error"

Now I'm not sure this is a bug - (the scripting.doc file has a section titled "Automatically called Scripts" that states:
"All .vbs scripts in Scripts\Auto folder are automatically checked during MM start-up and in case there is ‘OnStartup’ procedure present, it is called"
But I really want to get on with some MediaMonkey Scripting and VBScript sucks the creativity out of me.


Please consider fixing this - It'll definitely be worth your while.

Top