Tools: Difference between %_path% & %_directory% #& debugging?

I recently tried to enter a specific tag in a non-standard way to cater for some third-party software (see

and found it to be impossible with mp3tag.
However, one user (hi Sergius!) told me about a command-line tool called id3.exe (GitHub - squell/id3: ID3 mass tagger) that can manipulate id3 tags, including the one that I need. Now I wanted to copy a tag generated by mp3tag (I chose TXXX:Series) to the non-standard tag and it worked when using it directly in the terminal. However, once I tried to apply it as a tool within mp3tag it stops working. I suspect something with the path/folder/filename but I can't seem to be able to debug it correctly.

The command line is (don't blame me for the names, it's just something our kids like to listen to... :grin:): .\id3.exe -2 -wTXXX:grouping "%{TXXX:series}" '\\minibox\Audio\Kinderkrams\Hörspiele\Bibi & Tina\Bibi & Tina - Folge 11 Papis Pony (Album)\05 Kapitel 04 - Papis Pony (Folge 011).mp3'

The parameters for the tool in mp3tag is as follows: -2 -wTXXX:grouping "%{TXXX:SERIES}" '%_path%' - which does not work.
I tried several other variations, with quotes, double-quotes, %_path%\%_filename_ext%, without any success. A terminal window opens and closes immediately, making debugging difficult.

Any ideas?

Just to be sure:
Why do you want to use Mp3tag at all if you like to use id3.exe anyway?

Could you just copy the content of TXXX:grouping to TXXX:series with id3?

Sorry, but I don't see why it would be useful to create an external tool and call it with parameters from Mp3tag if you could do this directly with id3.exe?

Answer to your title questions:

%_path% is the File name with path.
%_directory% is the Name of the file’s parent folder.

To debug such parameters, you could use/call a batch CMD file that only shows what you passed to it, stopping with a PAUSE command that waits until you press a key.

Thanks for the answers, will try them tonight.

As for the why, I do all of the other tagging & organising in mp3tag, just this one bit I cannot do and thus tried to use an external tool - I thought that is exactly what the tool option is for, right?

Just a warning: if you edit the files with MP3tag then you will always end up with the standard name for the tag field and not the emulation of a user-defined one.
The steps would be: finish editing in MP3tag, close MP3tag, proceed with using id3.exe and never touch the files with MP3tag again.
If you find it convenient to use the list from MP3tag to finish the editing, it may be worth a thought to create an export script that contains all the commands for batch job to call id3.exe for just the edited files.

Hello LyricsLover, it's nice to see you again...

I was trying to help Cantello, with the id3.exe program with a CMD file, for the Tag grouping, based on the file you wrote me...

Here is some info...

Cantello needs a TAG grouping (tiny), I believe with a .cmd file and id3.exe, there is a way to program this...


TAG GROUPING (IMAGE) 3
TAG GROUPING (IMAGE) 2

Here are the 2 results with Mp3tag...

There is a way - for sure. But I myself would not go the way using Mp3tag for this specific use case. Of course it's Cantello's decision how to procede.

id3.exe handles the tags - let's say - very flexible and doesn't care much about existing standards. Thats also the reason why you can write UPPER-/lowercase tags with id3.exe or as in this case a TXXX:grouping which should be GRP1 according to the ID3v2.3 and ID3v2.4 standard.

But this has already been discussed here as I read in the meantime.

In his public writings, he started talking about the program, id3.exe

That's why, I tried to help him with this method...

In our private writings, Cantello wanted to use Mp3tag, for all his tags, including Tag grouping

He will have to use a Tools, for this to work...

Now back from travel and trying a batch file. However, it seems as if the path variable is not expanded in my setup, it is just passed as "%_path%" to the batch file.

The batch file I used is:

@echo off
echo Parameter provided: %~1 %~2 %~3 %~4
echo Press any key to continue...
pause > nul

and the terminal output when invoking on a file in mp3tag is simply (wit the literal path variable in it, not changed according to the file):

Parameter provided: -2 -wTXXX:grouping %{TXXX:SERIES} %_path%
Press any key to continue...

The parameters given in Options->Tools is

-2 -wTXXX:grouping "%{TXXX:SERIES}" "%_path%"

Any idea what I might be doing wrong?

I would just use id3.exe to copy this particular tag and not let it touch anything else.

One problem with the GRP1 tag (and that is why I hesitate to open a bug report for audiobookshelf) is that it is not part of the id3v2.3 standard (d3v2.3.0 - ID3.org) but rather an Apple-proprietary addition that is now used widely.

As an alternative to id3.exe, does anyone know eyeD3, a stand-alone tool and a python library to modify id3 tags? It seems like it can copy the tag but I have not yet found out how exactly... :slight_smile:

Don't forget the trailing % after Series, please try it with:
-2 -wTXXX:grouping "%{TXXX:SERIES}%" "%_path%"

If that does not work for you, you should provide an example song with your current TXXX:grouping content - to reproduce it.

After some tests - and assuming the information you want to copy is currently saved in the tag SERIES:
image
the Mp3tag parameter to instruct the external 3rd-party commandline tool id3.exe to copy the content of SERIES into an additional non-standard TXXX:grouping tag would be:

-2 -wTXXX:grouping "%SERIES%" "%_path%"

image

This would result in:
image

IMPORTANT:
Never modify such songs again in Mp3tag. If you do that, the GROUPING tag will be changed from the current non-standard TXXX:grouping to GRP1 without giving you any information.

Your are totally right, that was the culprit. I was too blind to see that and I have now verified that it works as intended, thanks!

You have selected my answer #13 as solution.
I assume because of the hint with the % character?

As I just rechecked: The syntax in #13 will NOT work as parameter from Mp3tag and therefore not write an additional non-standard TXXX:grouping tag with the content of SERIES.

You should use the syntax in answer #14 in Mp3tag for Tools as parameter for id3.exe.

You mean the difference between "%{TXXX:SERIES}%" and "%SERIES%"?

Actually, I use %%{TXXX:SERIES}%% and it works. id3.exe wants to have the percent symbols and to prevent them from replacement by mp3tag, they are escaped by another percent sign.

       %<modifiers>{FRAME}
	      replaced	by  the	 content  of  the  FRAME frame in the selected
	      source tag; any frame writeable with the -w option can be	 used;
	      see COMPATIBILITY for more information.

As far as I understand it, you would not pass any tag content directly from Mp3tag to id3.exe using %%{TXXX:SERIES}%%

Using %%{TXXX:SERIES}%% as parameter in Mp3tag, you instruct id3.exe to copy the content of TXXX:Series by id3.exe itself - with its own tag reading code - and copy the read content into the one tag given after -w (as -wTXXX:grouping)

You would pass exactly this letters
Parameter 1: -2
Parameter 2: -wTXXX:grouping
Parameter 3: "%{TXXX:SERIES}%"
only the "%_path%" would be translated to
Parameter 4: "C:\Temp\path\to\your\filename.mp3"

With this syntax, you would not need Mp3tag at all. You could directly execute the command in a CMD window.

With the suggested syntax in answer #14, the 3rd parameter "%SERIES%" will be translated from Mp3tag with the current content in SERIES and pass:
Parameter 1: -2
Parameter 2: -wTXXX:grouping
Parameter 3: "Content of Tag SERIES"
Parameter 4: "C:\Temp\path\to\your\filename.mp3"
resulting in:
id3.exe -2 -wTXXX:grouping "Content of Tag SERIES" "C:\Temp\path\to\your\filename.mp3"

Of course you can use whatever syntax you need to achieve your goal.
IMHO it's important to see the different values passed from Mp3tag using the different syntax.

Thanks for the explanation, so far I did not even know that mp3tag can pass any more information along to the external tool except for those listed here. That is even easier than instructing id3.exe to copy the series tag.

I am still debating if a bug report for audiobookshelf is prudent, seeing as the GRP1 tag is not really standard but only widely accepted.

At least they should not refuse to read it.
Ideally, they should be able to cope with both: the user-defined TXXX field and the one using the id3 token.