by tj_junk » Tue Nov 28, 2006 12:30 pm
The following is a generic version of Steegy's script. It can be easily modified to open a selected file into any external app using MediaMonkey's right-click context menu.
To use:
1) Create a new textfile in the "...\MediaMonkey\Scripts\Auto" folder.
2) Copy the code below into the new textfile.
3) Modify the "myAppPath" and "myMenuOption" constants as desired.
4) Save the new file with your desired VBS filename.
(I chose "RunAppFromContextMenu.vbs".)
5) (Re)Start MediaMonkey.
Code: Select all
'*******************************************************************************
' RunAppFromContextMenu -
' Add a context menu option to open a selected track in an external application.
'
' To use:
' 1) Create a new textfile in the "...\MediaMonkey\Scripts\Auto" folder.
' 2) Copy the code below into the new textfile.
' 3) Modify the "myAppPath" and "myMenuOption" constants as desired.
' 4) Save the new file with your desired VBS filename.
' (I chose "RunAppFromContextMenu.vbs".)
' 5) (Re)Start MediaMonkey.
'
' Note: This generic script was created from Steegy's more specific "Mp3Splitter.vbs"
' (see "http://www.mediamonkey.com/forum/viewtopic.php?p=46830#46830")
'*******************************************************************************
Option Explicit
Const myAppPath = "C:\Apps\Music\Edit\Mp3trim\mp3Trim PRO.exe"
Const myMenuOption = "MP3Trim"
'*******************************************************************************
'*******************************************************************************
Sub onStartUp
Dim CMIArray
CMIArray = Array(SDB.UI.Menu_Pop_TrackList, SDB.UI.Menu_Pop_NP, SDB.UI.Menu_Pop_Tree)
Dim i, MI
For i = 0 To UBound(CMIArray)
SDB.UI.AddMenuItemSep CMIArray(i), 0, 0
Set MI = SDB.UI.AddMenuItem(CMIArray(i), 0, 0)
MI.Caption = myMenuOption
MI.OnClickFunc = "RunApp"
MI.UseScript = Script.ScriptPath
MI.IconIndex = 38
Next
End Sub
'*******************************************************************************
'*******************************************************************************
Function RunApp(arg)
Dim WShell, Result, Command
Command = Chr(34) & myAppPath & Chr(34) & " " & Chr(34) & SDB.SelectedSongList.Item(0).Path & Chr(34)
Set WShell = CreateObject("WScript.Shell")
Result = WShell.Run(Command, 1, 0)
End Function
'*******************************************************************************
By the way, I highly recommend MP3Trim. It is a very simple, yet highly effective program for editing mp3 files (e.g., removing silence, fade in/out, etc). Check it out at
http://www.mptrim.com/.
The following is a generic version of Steegy's script. It can be easily modified to open a selected file into any external app using MediaMonkey's right-click context menu.
To use:
1) Create a new textfile in the "...\MediaMonkey\Scripts\Auto" folder.
2) Copy the code below into the new textfile.
3) Modify the "myAppPath" and "myMenuOption" constants as desired.
4) Save the new file with your desired VBS filename.
(I chose "RunAppFromContextMenu.vbs".)
5) (Re)Start MediaMonkey.
[code]'*******************************************************************************
' RunAppFromContextMenu -
' Add a context menu option to open a selected track in an external application.
'
' To use:
' 1) Create a new textfile in the "...\MediaMonkey\Scripts\Auto" folder.
' 2) Copy the code below into the new textfile.
' 3) Modify the "myAppPath" and "myMenuOption" constants as desired.
' 4) Save the new file with your desired VBS filename.
' (I chose "RunAppFromContextMenu.vbs".)
' 5) (Re)Start MediaMonkey.
'
' Note: This generic script was created from Steegy's more specific "Mp3Splitter.vbs"
' (see "http://www.mediamonkey.com/forum/viewtopic.php?p=46830#46830")
'*******************************************************************************
Option Explicit
Const myAppPath = "C:\Apps\Music\Edit\Mp3trim\mp3Trim PRO.exe"
Const myMenuOption = "MP3Trim"
'*******************************************************************************
'*******************************************************************************
Sub onStartUp
Dim CMIArray
CMIArray = Array(SDB.UI.Menu_Pop_TrackList, SDB.UI.Menu_Pop_NP, SDB.UI.Menu_Pop_Tree)
Dim i, MI
For i = 0 To UBound(CMIArray)
SDB.UI.AddMenuItemSep CMIArray(i), 0, 0
Set MI = SDB.UI.AddMenuItem(CMIArray(i), 0, 0)
MI.Caption = myMenuOption
MI.OnClickFunc = "RunApp"
MI.UseScript = Script.ScriptPath
MI.IconIndex = 38
Next
End Sub
'*******************************************************************************
'*******************************************************************************
Function RunApp(arg)
Dim WShell, Result, Command
Command = Chr(34) & myAppPath & Chr(34) & " " & Chr(34) & SDB.SelectedSongList.Item(0).Path & Chr(34)
Set WShell = CreateObject("WScript.Shell")
Result = WShell.Run(Command, 1, 0)
End Function
'*******************************************************************************[/code]
By the way, I highly recommend MP3Trim. It is a very simple, yet highly effective program for editing mp3 files (e.g., removing silence, fade in/out, etc). Check it out at [url]http://www.mptrim.com/[/url].