ExternalTools v1.4 [MM2+3+4]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Post by Eyal »

BMF wrote: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.
That's because a Virtual CD file is not the ripped file but a pointer to the CDA track on the CD.

So the parameter passed to the application is:
[ ?:\Track01.cda ]
or whichever letter that designates your CD drive.
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

In the script's code (ExternalTools.vbs) change

Code: Select all

TracksString = TracksString + QStr(Song.Path) & " "
to

Code: Select all

If Song.Cached Then
    TracksString = TracksString + QStr(Song.CachedPath) & " "
Else
    TracksString = TracksString + QStr(Song.Path) & " "
End If
and

Code: Select all

Command = Trim(QStr(Tool.ProgramPath) & " " & Tool.CLArguments & " " & QStr(Song.Path))
to

Code: Select all

If Song.Cached Then
    Command = Trim(QStr(Tool.ProgramPath) & " " & Tool.CLArguments & " " & QStr(Song.CachedPath))
Else
    Command = Trim(QStr(Tool.ProgramPath) & " " & Tool.CLArguments & " " & QStr(Song.Path))
End If
Then it should work (I currently can't test this myself). Is this correct?
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
BMF
Posts: 281
Joined: Sun Jul 01, 2007 5:11 am
Location: Berlin, Germany

Post by BMF »

Hello Steegy,

just came home from work and saw the mail alert :). I changed the script as you described ... and ... it works perfectly right now.

So I may be the first user of External Tools v1.3 or 1.2.01 :D.

Thank you Steggy.
nothing but a bmf ....
--------------------------
Windows 10 Professional (64 Bit); MM 5 (lifetime licence);
iPod Classic, Sonos
phunkydizco
Posts: 42
Joined: Sun May 22, 2005 10:56 am

Post by phunkydizco »

I want to run an external program with some parameters for the selected tracks, such as artist, album and year. Is this possible?
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

That was supposed to be included from the start. I must somehow have forgotten about it. Will do.

EDIT: Done. ExternalTools 1.25 lets you add some 'field masks' to the "parameters" box. Use these masks only with the 3rd Selected Tracks option.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
phunkydizco
Posts: 42
Joined: Sun May 22, 2005 10:56 am

Post by phunkydizco »

Thank you for the field masks. There seems to be a bug or I am to silly.

I use this parameters:

Code: Select all

/artist "%A" /album "%L" /path "D:\Musik\Alben\%A\(%Y) %L\Folder.jpg"
And this is with the external program gets:

Code: Select all

>"C:\Programme\AlbumArtDownloader\AlbumArt.exe"  /artist "Guns N' Roses" /album "Use Your Illusion Vol. 1" /path "D:\Musik\Alben\Guns N' Roses\(1991) Use Your Illusion Vol. 1\Folder.jpg" "D:\Musik\Alben\Guns N' Roses\(1991) Use Your Illusion Vol. 1\01. Right Next Door To Hell.mp3"
The last parameter for the external program is the path to the file, but I haven't set this in external tools.
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Yeah, I've should have mentioned that.

The executed command is: ProgramPath Parameters [SongPath1, SongPath2, ...]

As it is now (because I wanted to keep it 'simple' and because it didn't seem to be an issue), the SongPath is always appended when applicable. So the last "parameter" (that you haven't set) is not a parameter, but the SongPath. Of (one of) the selected song(s).

If this is an issue for you, you could try

Code: Select all

/artist "%A" /album "%L" /path "D:\Musik\Alben\%A\(%Y) %L\Folder.jpg" /foobar
as parameters. Some programs will ignore the foobar parameter (and thus the appended SongPath value) as they don't know it, but some programs will return an error message. If the latter is true, tell me and I'll change the script asap so that it's more useful and logical (but slightly more programming work :wink:).
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
phunkydizco
Posts: 42
Joined: Sun May 22, 2005 10:56 am

Post by phunkydizco »

This doesn't work. It's not possible to start the external program with an unknown parameter.
phunkydizco
Posts: 42
Joined: Sun May 22, 2005 10:56 am

Post by phunkydizco »

Steegy wrote:Yeah, I've should have mentioned that.

The executed command is: ProgramPath Parameters [SongPath1, SongPath2, ...]

As it is now (because I wanted to keep it 'simple' and because it didn't seem to be an issue), the SongPath is always appended when applicable. So the last "parameter" (that you haven't set) is not a parameter, but the SongPath. Of (one of) the selected song(s).

If this is an issue for you, you could try

Code: Select all

/artist "%A" /album "%L" /path "D:\Musik\Alben\%A\(%Y) %L\Folder.jpg" /foobar
as parameters. Some programs will ignore the foobar parameter (and thus the appended SongPath value) as they don't know it, but some programs will return an error message. If the latter is true, tell me and I'll change the script asap so that it's more useful and logical (but slightly more programming work :wink:).
Is it possible to leave out the SongPath?
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Thanks for the bump, otherwise I wouldn't have seen this. I'll get right to 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

Post by Steegy »

I think I'll go with a solution where you can select:

When the tool is activated
- run the tool once
- run the tool for each selected track

Parameters as given in the first post will be possible for both choices.
Everything between [ and ] will be repeated for each track. (* could split the text from the separator)

So e.g. "-alltracks [%S*,]" could create "-alltracks Title1,Title2,Title3,Title4" for 4 selected tracks

"[-track# %S* ]" could create "-track1 Title1 -track2 Title2 -track3 Title3 -track4 Title4" for the same 4 selected tracks

This would be quite advanced, but also more difficult to use maybe.

Let me know if you have a better idea.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
phunkydizco
Posts: 42
Joined: Sun May 22, 2005 10:56 am

Post by phunkydizco »

Steegy wrote:I think I'll go with a solution where you can select:

When the tool is activated
- run the tool once
- run the tool for each selected track

Parameters as given in the first post will be possible for both choices.
Everything between [ and ] will be repeated for each track. (* could split the text from the separator)

So e.g. "-alltracks [%S*,]" could create "-alltracks Title1,Title2,Title3,Title4" for 4 selected tracks

"[-track# %S* ]" could create "-track1 Title1 -track2 Title2 -track3 Title3 -track4 Title4" for the same 4 selected tracks

This would be quite advanced, but also more difficult to use maybe.

Let me know if you have a better idea.
Did you add this to v1.25? I think this really complex and don't know if this will eliminate the songpath problem. I have to test it.
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

I haven't added it yet (only did a test for it), but I would appreciate some suggestions. It would correct the songpath problem, but it's complex indeed. Complex but powerful.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
phunkydizco
Posts: 42
Joined: Sun May 22, 2005 10:56 am

Post by phunkydizco »

Why don't you make a parameter for songpath or filename and launch the external tool without any parameters. Ok, this would make it incompatible to the old version, but then it will be more flexible. I like your suggestion to make the parameters available for one instance of all selected tracks. So it would be possible to launch an external program in album view with parameters for artist, album and path. That's what I want.
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

The script has been updated to v1.3, making it possible to use parameter loops (as discussed above but implemented slightly differently).
See the information on the first post to see how it behaves.

Make sure to check (and if necessary update) your existing tools set within ExternalTools. External tools will not automatically append the file paths anymore. This have to be specified manually as parameter.

If there's something not clear, please feel free to ask here. Also if you have a better way of explaining things :)
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Post Reply