ExternalTools v1.4 [MM2+3+4]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

ExternalTools v1.4 [MM2+3+4]

Postby Steegy » Thu Feb 15, 2007 8:39 pm

:: Script ExternalTools v1.4

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), ...


Installation Package: ExternalTools14.mmip


Screenshot (v1.4):

Options sheet:
Image


Screenshots (v1.3):

Options sheet:
Image

Toolbar submenu:
Image

Context menus on tracklists and tree:
Image


Version history/details:

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.

Version 1.3 lets you use the following field masks in the "Parameters" box:
%A --> ArtistName
%C --> Author
%G --> Genre
%L --> AlbumName
%M --> BPM
%R --> AlbumArtistName
%S --> Title
%T --> TrackOrder
%B --> Bitrate
%U --> Custom1
%V --> Custom2
%W --> Custom3
%Y --> Year

And these 3 (will automaticaly be quoted ' '):
%O --> Full path
%P --> Directory/folder (without ending \)
%F --> File name

Version 1.4 adds some minor bug fixes, MM Installation Package support, changed/added parameters: %O = full path, %P = directory/folder (without ending \), %F = file name

You can also specify parameter loops by using the syntax SomeText <LoopParameter:Separator> SomeOtherText
# serves as counter.


Examples:

Resulting parameters conversions when 4 tracks are selected with artist ArtistX and title TrackX:
  • -titles "<%S: >" _means_ -titles "Title1 Title2 Title3 Title4"
  • -currentorfirsttitle "%S" -alltitles <"%S":,> _means_ -currentorfirsttitle "Title3" -alltitles "Title1","Title2","Title3","Title4"
  • -currentorfirsttitle %S <-title# %S: > _means_ -currentorfirsttitle Title3 -title1 Title1 -title2 Title2 -title3 Title3 -title4 Title4
  • <-title# %S: > <-artist# %A: > _means_ -title1 Title1 -title2 Title2 -title3 Title3 -title4 Title4 -artist1 Artist1 -artist2 Artist2 -artist3 Artist3 -artist4 Artist4
  • <-title# %S -artist# %A: > _means_ -title1 Title1 -artist1 Artist1 -title2 Title2 -artist2 Artist2 -title3 Title3 -artist3 Artist3 -title4 Title4 -artist4 Artist4
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:
  • First instance's parameters: -currentorfirsttitle "Title1" -alltitles "Title1","Title2","Title3","Title4"
  • Second instance's parameters: -currentorfirsttitle "Title2" -alltitles "Title1","Title2","Title3","Title4"
  • Third instance's parameters: -currentorfirsttitle "Title3" -alltitles "Title1","Title2","Title3","Title4"
  • Fourth instance's parameters: -currentorfirsttitle "Title4" -alltitles "Title1","Title2","Title3","Title4"
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:
  • Only instance's parameters: -currentorfirsttitle "Title1" -alltitles "Title1","Title2","Title3","Title4"

When no tracks are selected, then the parameters and parameter loops will be omitted. Then the result would be:
  • -titles "<%S: >" _means_ -titles ""
  • -currentorfirsttitle "%S" -alltitles <"%S":,> _means_ -currentorfirsttitle "" -alltitles
  • -currentorfirsttitle %S <-title# %S: > _means_ -currentorfirsttitle
  • <-title# %S: > <-artist# %A: > _means_
  • <-title# %S -artist# %A: > _means_

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.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby Teknojnky » Thu Feb 15, 2007 9:45 pm

Very cool!
Teknojnky
 
Posts: 5521
Joined: Tue Sep 06, 2005 11:01 pm

Postby pah68 » Thu Feb 15, 2007 10:53 pm

Very Noice
Image
Image
pah68
 
Posts: 1484
Joined: Wed Apr 07, 2004 5:26 pm
Location: Sydney, Australia

Postby Son of Spam » Sat Jun 16, 2007 9:09 am

Okay, I see how the concept for implementing this script works.

BUT.......

I'm not as technical as I'd like to be.

When I click on "Add", nothing comes up.

And for "Name": is this my creation, ie. "Edit File In Audacity", for example?

And what do I put for "Parameters"?

Sorry to sound so ignorant. Like I said, I'm not very technical (but I can get by, lol!).
Beware The Lollipop Of Mediocrity:
Lick It Once, And You Suck Forever.
Son of Spam
 
Posts: 242
Joined: Sat Apr 21, 2007 9:26 am
Location: Earth

Postby Son of Spam » Sat Jun 16, 2007 9:16 am

LMAO!

I guess I'm not as dumb as I though I was. I restarted the Monkey, followed the instructions, and restarted again.

Works like a charm!
Beware The Lollipop Of Mediocrity:
Lick It Once, And You Suck Forever.
Son of Spam
 
Posts: 242
Joined: Sat Apr 21, 2007 9:26 am
Location: Earth

Postby Eyal » Sat Jun 16, 2007 9:28 am

Great tool utlity. :D
This will replace my 5 scripts, and it's easier and faster than going through the scripts menu.

Thank you Steegy.
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 3099
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Postby darchangel » Tue Jun 19, 2007 4:32 pm

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
 
Posts: 26
Joined: Wed Nov 30, 2005 11:23 pm

Postby Steegy » Tue Jun 19, 2007 5:32 pm

@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).
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby SHR » Wed Jun 20, 2007 8:25 pm

Your script is a great for adding external tools!

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?
SHR
 
Posts: 51
Joined: Sat Jan 20, 2007 11:17 am
Location: Cologne, Germany

Postby Steegy » Thu Jun 21, 2007 5:38 am

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).
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby Steegy » Thu Jun 21, 2007 8:59 am

I uploaded a new version that can be downloaded from the first post. Feel free to give better wordings for the "selected tracks" choices.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby SHR » Fri Jun 22, 2007 3:10 am

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 :wink:) 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. :D But there aren't so much ways to do this. Right?!

Anyway thanks for the new version and the quick response.

BTW: How about assigning own icons to the Tools in the toolbar?
SHR
 
Posts: 51
Joined: Sat Jan 20, 2007 11:17 am
Location: Cologne, Germany

Postby drogba » Sat Jun 23, 2007 5:01 pm

Steegy,what skin is that from?
you wouldn't mind posting a link
drogba
 
Posts: 11
Joined: Sat Jan 13, 2007 2:25 am

Postby Steegy » Sat Jun 23, 2007 5:52 pm

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.

drogba wrote:Steegy,what skin is that from?

See the skins Wiki page or the skin's forum page.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby BMF » Sat Jul 14, 2007 11:38 pm

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 :).
nothing but a bmf ....
--------------------------
Windows 10 Professional (64 Bit); MM 4 (lifetime licence);
iPod Classic, Sonos
BMF
 
Posts: 170
Joined: Sun Jul 01, 2007 5:11 am
Location: Berlin, Germany

Next

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 11 guests