Run a TOOL Command, based on selection, in a SINGLE WINDOW

I was hoping if someone could help me: I am using MP3Tag & mkvpropedit, via MP3Tag GUI Tool option (please see attachment), in order to retain the Encoded date within this parameter:

--edit info --set date="%creation_time%" "%_path%"

The command does as intended but my issue is that once I run the tool on the files that I selected, multiple windows show up, instead of a SINGLE window handling the same command for the selected files.

Basically, I want to know if there is an additional code that I can add into the parameter that would either hide the terminal or force that one action into a single command window terminal? For example, from the image shown below, it's insane how all 25 different Windows appear just to execute that one command on 25 files, when it should be able to do that in a single windows based upon my selection.

I will appreciate the help or advice from anyone.

I guess, that this is up to your called external tool (mkvpropedit).

Mp3tag just execute your defined command line per selected track.
I suggest that you find a way how mkvpropedit close it's own window after successfull execution.
Maybe something that make use of the exit codes?

Or maybe you could write an external cmd batch file with the help of the Mp3tag export function?

Maybe this thread gives you some informations:

thanks for responding. I tried the exit code method, but it was unsuccessful, unless I am doing something incorrectly below because the command didn't work.

--edit info --set date="%creation_time%" "%_path%" --if %errorlevel% equ 1

I appreciate the response as well, but I am unsure regarding how to create an MTE file regarding the command line I want to include. Any way you can help me since my task is just one line?

In the meantime I have used your command line on my own tracks.
I can see the window popping up for less then a second on my system, closing itself after making the changes.

Unfortunatley I can't say, why the windows remain open in your case...

It seems that the MTE is the only method for me try, but I have no idea how to code it regarding the parameters. Moreover, I also appreciate that you had the same issue that I promised regarding MP4 metadata because I thought that I was the only one:

Do I understand you correctly:
The mkvpropedit window (per selected track) is visible only a short time and then disappear automatically for you?
Or do they remain open until you close it manually?

They're visible only for a short time and then disappear, but the issue was that I wasn't aware about it, especially when I selected over 150 files to process at once that almost crashed the computer lol

Create a new export with soemthing like

$filename(mkvbat.txt,utf-16) $loop(%_filename%)mkvpropedit --edit info --set date="%creation_time%" "%_filename%"
$loopend()

Run the script and then rename the resulting TXT file to BAT and execute it in a command shell window.
A word of warning: I have no clue whether the command line itself is correct. You have to test it - and then perhaps tell us whether and how it worked.

Thanks, but it didn't work

It is always MUCH easier if the statements about working or not working functions are a LOT more detailed.
Like
What did you do to create the export?
Did you get any error messages?
Which step did not work?

My apologies. I did as instructed, and the text file produced:

mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E01"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E02"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E03"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E04"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E05"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E06"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E07"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E08"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E09"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E10"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E11"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E12"
mkvpropedit --edit info --set date="2009-12-25T12:25:30Z" "The Fresh Prince of Bel-Air (1990) S03E13"

Then, I changed the file extension to .bat, and ran the script. The dates weren't changed, post running the .bat

So, did you check the syntax for your tool?
I mean, the script itself produced a valid output right?
Which messages did you get when running the batch file?

There was no message: command window opened and closed rapidly. Nonetheless, I have never ran a .bat file without adding the directory, along with other necessary components, below, which is why I am confused on how to proceed:

**for %%x in (*.mkv .mka .mks) do "C:\Program Files\MKVToolNix\mkvpropedit.exe" "%%x"

you could open a command shell in the folder where the bat file is located.
Then run the batch file from the command shell prompt.

Apologies, but I was unable to comprehend what you asked of me, but, with one draw back, in which I will elaborate on, I did manage to figure it out via a previous post, provided by @poster, passing multiple selected items to external tool - #3 by tezza

The only draw back, from the MTE below, is that I can only process/export one file at a time, regardless of when I select the files I want processed or not. Moreover, I created an "ACTION" which did not work at all, for some reason. Anyway, you or anyone in this post can tell me what I am missing in the attacked .mte below

mkvpropedit_set creation time to encoded time.mte (2.0 KB)

I am the author of the script you used.
It was written to execute an application that allows multiple files as command line arguments.
But I believe that mkvpropedit allows only 1 file on it's command line.
I have attached a modified script to execute mkvpropedit, once for each file.
1Tools___Execute_Application-multiple_times_once_for_each_file.mte (1.8 KB)

However, there is minimal error-handling or notification of success or failure.

Maybe you would rather use the simpler script as described by @ohrenkino.
If so, take note of the following modifications:

  • Unless mkvpropedit is in your path, you must use the fully qualified path, for example:
    "C:\Program Files\MKVToolNix\mkvpropedit.exe"

  • Also, I believe that mkvpropedit command lines expect a MKV file, for example: "C:\any path\to\movie.mkv"
    In Mp3tag, the placeholder is %_path%.

  • The BAT file will not execute if encoded with UTF-16. Use UTF-8 instead, as shown.

$filename($getEnv(USERPROFILE)\Desktop\mkv.bat,utf-8)$loop(%_path%)"C:\Program Files\MKVToolNix\mkvpropedit.exe" --edit info --set date="%creation_time%" "%_path%"
$loopend()
pause

This will create a BAT file on the Desktop that will execute if you click "Yes" when Mp3tag asks "Display Export file now?".
(Make sure you show a message when exporting tags: Options > Messages > check-mark "at exporting tags")

Thank you. IT WORKED PERFECTLY. Likewise, @ohrenkino, thank you as well: I guess I was confused because the file path was for mkvpropedit was absent, and I have never used an MTE file. Nonetheless, @ryerman, could you explain to me why the MTE file doesn't work when an create an Action for it?

1 Like

When an "Export" is performed using the menu on the toolbar, there is the opportunity to "display" the file that is created.
But what actually happens is that the file is opened (ie executed) by whatever default application is associated with the created file type, given by the extension.
That happens if you click "Yes" when Mp3tag asks "Display Export file now?"
So a BAT file would be executed by the Command window, a TXT file might be opened by Notepad, a VBS file might be opened by the Wscript script engine, etc.

When an export is used as an action, Mp3tag does not ask the question "Display Export file now?" and there is no opportunity to display/execute/run the created export file.

If you must use an action to perform an export, you can always create the exported file in a convenient place (like the Desktop), and open it manually.

Did you try the 3 line export script in my previous post?