passing multiple selected items to external tool

Okay so I am adding xrecodeII.exe as an external tool. It has a fairly rich set of command line invocation options.

I am invoking it thusly at the moment

/sendto "%_path%"

but that means xrecode can only receive one item at a time from mp3tag.
I need it to receive all selected items.

I also have implemented

/sendto "%_folderpath%"

but that gets me the whole folder (something separate to what I am looking for).

I didn't spot any scripting functions that would return a space-separated list of URIs for all selected files.

In Mp3tag's configuration of the tool, do you see the checkbox labeled "for all selected files"? Check that box and see if it does what you want.

Hi JJ,

I did try that, and all it does is launch an extra instance of the application (xrecode) for each file that is selected.

It does not pass a space separated list of each object.

Unless I am missing something, and there is another way to do it, there needs to be a function such as $list([item],[deliminator]) which does the job.

list("""+%_path%+"""," ")

I have not found a way to use "Tools" with a space-separated list of URIs or any other information.

Sometimes, checking "for all selected files" causes an application to open once, with all files.
But sometimes it results in multiple instances opening, one for each file.

A way to overcome this limitation is to use what might be called "Export Tools". (my words)
Forum member DetlevD has pioneered this approach. See /t/10808/1

To summarize:
Create a Mp3tag export script that writes a script file (eg. BAT, VBS) incorporating all selected filepaths.
Use the "Export" feature to send selected files to the Mp3tag export script.
Execute the 3rd party script by clicking "Yes" when asked "Display Export file now?" after exporting is complete.

I use export scripts that create VBS scripts.
The VBS scripts formulate and run command lines for various applications.
Besides allowing multiple files to be sent to an application, other benefits to this method are that the command window can be made to not appear, and the VBS file can be deleted by the script.

For example, attached is a simple MTE file that creates a script to open the VLC media player with all selected files.
Maybe you can modify it to suit your purposes.

1Tools___Execute_Application_with_Space_Separated_Filepath_List.mte (2.03 KB)

Exporting is easily one of Mp3Tag's best features, definitely. Can also confirm DetlevD is a genius :wink:

Okay I will take a look at a scripting option then but I have no idea what an MTE file is. I've never used VBS before. I've only scripted in PHP so could use that I to save time suppose. I did think of that before but was hoping that there was an easier method that I just hadn't spotted. Seems kinda obvious to have a way to pass a selected list to another program.

Thanks for the tips. I will check out that other thread too.

No argument from me. I agree that passing a selected list would be a very useful feature.

An MTE (Mp3tag Export) file is used by Mp3tag to export tag and file information.
They are text files with an "mte" extension, and can be created in any text editor or by choosing "New" in the "Export" :mt_export: dialogue.
If you create them outside Mp3tag they should be installed in "%APPDATA%\Mp3tag\export"

The trick is to use the "Export" functionality (which creates a text file) to write a script file that is executed when opened by the operating system.

I have some experience with VBS and no knowledge of PHP.
On my system, VBS files are executed when opened. Maybe that is the case for PHP files.

Ask, if you want any help to customize the example VBS script.
Your original post suggests customization will require minor changes.

Invoking a commandline executable file needs always a special look for a method how to transfer one or more filenames into the process of the executable file.

In case of the "xrecode.exe" there seems to be no input option for a simple "line by line" "vertical" list file.
But there is the option "/sendto .. .. ..", which adds all specified files/folders as input parameters.
Anyway ... I think you can use that.
You have to write a Mp3tag MTE script, which is able to create such a "item by item" "horizontal" "space separated" list of filenames, with each parameter included in double quotes.
This should be feasable, using the commands, respectively functions, $loop, $put, $get and so on from the Mp3tag Export Scripting Language.
Note: the option "/sendto .. .. .." has a risk for automated processing, because of the length limitation of the DOS command line.
See also ...

Regarding the wanted xrecode processing, you can take into account to invoke xrecode.exe consecutively, for each given media file separately, one by one, from within the batch file, created by the Mp3tag export feature.

If you want to get an impression how to create a batch command file by using the Mp3tag Export feature, then have a look at this FPCALC example ...

There are other example scripts buried in the Forum, you gotta find them.