OK here what some users and me found out few months ago:
'MM script executes Script.vbs'
Code: Select all
'==========================================================================
'
' NAME: Test VBScript Execution On MM Start
'
' AUTHOR: Peke
' DATE : 13.04.2005
'
' COMMENT: Example How To Execute VBScript within MM Script
'
'==========================================================================
Sub OnStartup
'make variables
Dim WShell, Command, Result
'Create Shell Object
Set WShell = CreateObject("WScript.Shell")
'--------------------------------------------------------------------------
'Set Shell command to execute first Script
Command = Chr(34)&"Script1.vbs"&Chr(34)
'Execute first script and report execution code in Result
Result = WShell.Run(Command, 1, 1)
'--------------------------------------------------------------------------
'If needed use Result to see if script is executed corectly
'in case result is 0 all went OK
'--------------------------------------------------------------------------
'Set Shell command to execute second Script
Command = Chr(34)&"Script2.vbs"&Chr(34)
'Execute second script and report execution code in Result
Result = WShell.Run(Command, 1, 1)
'--------------------------------------------------------------------------
'If needed use Result to see if script is executed corectly
'in case result is 0 all went OK
End Sub
OK Put this script into MM auto Folder and it will be executed on MM startup. You can do what ever you want if you combine MM UI to assign script execution on desired command but basics are here. You can use arguments or whatever in starting script.
And Script1.vbs and script2.vbs looks Similar to this one:
Code: Select all
'==========================================================================
'
' NAME: Example Script
'
' AUTHOR: Peke
' DATE : 13.04.2005
'
' COMMENT: This example inits basic MM Variable Needed or any external
' VBScript executed outside MM(Command shell, Windows Explorer)
' or within script as separate script.
'
' WARNING: MediaMonkey Needs to be started prior to execution of Script
' if script is executed from Windows Explorer or command shell
'
'==========================================================================
'---< DO NOT DELETE THESE LINES FROM SCRIPT >------------------------------
'Define MM Default variable used within MM Scripting Language
Dim SDB
'Create Inits MM Object and Scripting Language
Set SDB = CreateObject( "SongsDB.SDBApplication")
'Set MM to Stay Started after Script execution
SDB.ShutdownAfterDisconnect = False
'---< DO NOT DELETE THESE LINES FROM SCRIPT >------------------------------
'---< Write Your own script below this line >------------------------------
'In This Script we will instruct MediaMonkey to skip to next track just for
'example instead of whole script you will write
SDB.Player.Next
I hope I have cleard something.
P.S. For command line and use of .arguments it will look like this:
Command = Chr(34)&"Script1.vbs"&Chr(34)&Chr(32)&Chr(34)"My Function"&Chr(34)