This script provides a standard way of adding external tools/applications to MediaMonkey. These tools can use the tracks that are selected in MediaMonkey.
Some possible applications: external music players (e.g. Winamp), encoders (e.g. AAC Encoder), editors (e.g. mp3DirectCut, CoolEdit), ...

Version 1.2 adds an option to set an icon for each tool.
It also adds a confirmation when a lot of applications (10 or more) are going to be started due to a lot of selected files for a tool with "for each selected track, use an instance", to avoid mistakes.

When "Run it for each selected track" is chosen (as supposed in the example), all parameters outside of a parameter loop will be taken from the executed instance (here the 3rd of the 4 tracks). So in this example the tool will be launched 4 times, for tracks 1, 2, 3, 4 (in the example the resulting parameters for the 3rd instance are shown).
E.g. for the 2nd example:

When "Run it once" is chosen, the first track in the selection will be used (track 1). So the tool will only be run once, and in the example you have to replace Title3 (in red) with Title1.
E.g. for the 2nd example:

In the future an extra option could be added to the tool specification, that at least one track must be selected for the tool to be launched. This would prevent launching a tool that expects selected tracks, when no tracks are selected.

If you have questions about this, feel free to ask here.

Last edited by Steegy on Sun Jun 12, 2011 5:58 pm, edited 11 times in total.

In what language is this written? Would you be willing to make the source project available for download? As far as I can tell you are a C# dev'er and not too shabby of one at that. I'd love to look at your code and see how to interface with MM without going out of my skull. [see 'whack-a-mole' comment in thread: Events in .NET winforms: more of what works and what doesn't]

@darchangel: it's just a MM script written in VBScript. The exe program file is just the installer. Once it is installed in MM's Scripts folder, you can open the script file and edit it if you want. I know that this script is very basic (e.g. the configurations "look" is quite bad) so feel free to improve it if you want, but please keep things about it in this thread (btw: the installer script is quite basic, but if you want it I can give it).

But there is just one thing, that I miss. I use your script to call e.g. MP3DirectCut. This works well for just one track, but causes sometimes errors when multiple tracks are selected. So do you plan to add a call-this-tool-for-each-track-function?

Some programs (like Winamp; or all?) give errors when they are given a lot of file names as command line parameters.
Sometimes it's possible to call the program multiple times after each other, everytime using another file name, but sometimes this isn't what someone wants. (some programs would open multiple instances when just 1 instance in wanted, ...)
I haven't found a solution yet to the "multiple file paths as command line parameters" issue. Maybe it's just the length of the command line that is limited.

But what you suggest is very good possible (but as I said above, it doesn't solve the problem is all cases).

You are right. Long commandlines are an issue and not always I want multiple instances. So I think, that there is no general way to handle it. But some programs know some kind of ADD-Parameter e.g. other player with playlists or tab/window-support. Or it is possible to limit these programs to one instance as an option. So your script can now call to append the tracks to the existing instance one by one. (not always nice, but still works) The new feature to call different instances is very good for me, as e.g. MP3DirectCut or some converter can handle only one file per instance. Although there is an issue for me with calling e.g. 100! instances. (But who wants to do this ) Maybe a limit and or limitcheck can help to avoid unwanted lockups with calling the script more than x-times.

Meanwhile I played around with your script and implemented the new feature in nearly the same way (radiobuttons, etc.). Except for the setting of a calllimit with a warning. But there aren't so much ways to do this. Right?!

SHR wrote:Maybe a limit and or limitcheck can help to avoid unwanted lockups with calling the script more than x-times.
...
BTW: How about assigning own icons to the Tools in the toolbar?

Good suggestions, both things have been implemented in v1.2. The default warning threshold for starting applications is 10. So when 10 or more selected tracks would cause that many application instances to be started (e.g. of mp3DirectCut), then a confirmation will be asked.

I am using the script for quite a while now. I prelisten to songs over earphones with another program (VLC) which is connected to a second sound card. Learning more about the monkey itself i am starting to use the "virtual cd" option to keep my library in order and avoid double entries. Now the following occurs: when i like to prelisten to a song that is stored in a virtual cd nothing happens. the vlc opens but doesn't play the selected song. I wonder if i may add special parameters for this kind of situation, but i am not familiar with it. so i would appreciate kindly hints .