Set pre-defined Tag remotely

Hello all.

That's my first post here, gimme welcome :slight_smile:

I want to perform a bulk task operation to help me set genres automatically.

I have a directory, where I keep my mp3, with almost 1 thousand albums. These folders are referred to band name [country] symbol #genre. Like those below:

Black Sabbath [UK] :radioactive: #Doom, Heavy Metal
Cactus [USA] :radioactive: #Psychedelic Rock
Steppenwolf [USA] :radioactive: #Classic Rock, Psychedelic
Thin Lizzy [Ire] :radioactive: #Classic Rock, Hard Rock

Got it, right?

Inside these folders, I got album folders with the following names (not that important):

inside "Black Sabbath [UK] :radioactive: #Doom, Heavy Metal", we got for example:

Black Sabbath [1970] » Black Sabbath
Black Sabbath [1970] » Paranoid
Black Sabbath [1971] » Master of Reality
Black Sabbath [1972] » Black Sabbath Vol. 4
Black Sabbath [1973] » Sabbath Bloody Sabbath

And inside those folders, I have common mp3 files (and an occasional front.jpg along)

Ok, Here's the deal:

I have developed an AutoIT script to do the following:

  1. Get folder name inside MUSIC directory (almost 1 thousand folders) using the function "filefindfirstfile".
  2. Get the name of the Band folder, like "Black Sabbath [UK] :radioactive: #Doom, Heavy Metal" and set the value to a variable called "$albumFolder"
  3. Get the Genre tag string (after the "#") from the variable "$albumFolder" and set it to a variable to be called "$genreSet", via "stringsplit" function.

Now its when it gets tricky:

  1. Send some sort of command or parameter to mp3tag to set the tag "genre" of all the music files inside every folder below "$albumFolder" to "$genreSet".

  2. Then, proceed to the next folder reading, using "FileFindNextFile" funcion.

I just don't know how to perform the 4th step yet.

First of course, I need to find a way to do that from a command line (cmd) parameter or something like that. Example:

C:\Program Files\Mp3tag> Mp3tag.exe folder="D:\Music\Black Sabbath [UK] :radioactive: #Doom, Heavy Metal" genre="Doom, Heavy Metal"

Is there a way to do that with Mp3Tag?

if not:

Is there a way to that with a powershell parameter kit or something?

Thanks in advance!

Why do you want to fiddle about with CMD parameters if you can just as easily (and probably easier) use the Convert functions of MP3tag?

Incorporating the backslash to address folders and using %dummy% to leave out superfluous information should do it all for you.

Black Sabbath [UK] :radioactive: #Doom, Heavy Metal\Black Sabbath [1970] » Black Sabbath\file.mp3
could be extracted like this:
Use Convert>Filename-Tag
enter as pattern
Have a look at the preview if it fits.

I think I got you, I'll try that as soon as I get home. Didn't know that was possible using mp3tag. I even downloaded some ID3 UDF to start messing with it at home later.

I'll let you know what happens.


Well. It worked!

Thank you.

But the preview showed me nothing. I don't really understand the concept of %dummy%. Is that an uplevel or something? Can you explain what happened to me?


MP3tag understands a certain syntax to name variables for fields.
%genre% stands for the contents of the field GENRE (amazing, right? ;-))
You find a complete list in the online help.
For the converter you have to define a pattern which may consist of bits and pieces that you want to copy to a field and others that you want to ignore - which is dummy information -> %dummy%.

The pattern I offered you uses the file name.
The plain filename is nothing but the name plus the extension.
You can expand the filename to a "relative" address by adding a backslash - which is the folder separator. Theis then eanbles you to use the information stored in the folder name. And adding another backslash in front addresses the folder above that one.

100% understood! Thanks again.

I also noticed that some albums that have a "CD1" and "CD2" additional folders will require one more %dummy% from each side.

Problem solved!

Hello again.

Here I am ressurecting a post considered dead.

Somehow its not working with a pattern that I used to fix all my folders.

I'm trying to create a pattern for the stereo of my new car, so, it would have to be like %artist%(%album%) at the name of the folder.

I tried it in several ways, but still am unable to set them.

Take a look:

I have a folder called: Dream Theater [1994] » Awake

I want to change it to: Dream Theater (Awake)

OBS: The pattern should be %artist%(%album%)

Here's what I've been trying:

CTRL+2 (filename - tag)

%dummy%%artist%(%album%)\%dummy% = nothing happens

%dummy%%artist%(%album%)\%dummy%\%dummy% = nothing happens

%artist%(%album%)\%dummy%\%dummy% = nothing happens

%artist%(%album%)\%dummy% = nothing happens

I'm out of ideas. What am I missing?

The converter filename - tag does not work as renamer for an existing folder.
If you have the fields filled that shall determine the new folder name then use the converter
for _directory
and enter the new pattern, e.g.
%artist% - (%album%)

This should rename the current folder.
If you find that you need nnew and more folders, (because tracks for 2 albums are in one folder together and you want to have a separate one for each album), use the converter
filename - tag
with a pattern like
%artist% - (%album%)$num(%track%,2) - %title%

Actions -> Quick Actions -> Format Value

Use _DIRECTORY in the Field: to change the 'folder' name.

Convert | Tag - Tag | ALT+5
... or...
Action | Format value


Format string:

$regexp(%_directory%,'^(.+?)\s\[\d{4}\]\s»\s(.+?)$','$1 ($2)')

... or ...

%ARTIST%' ('%ALBUM%')'

from folder name:
Dream Theater [1994] » Awake
to folder name:
Dream Theater (Awake)

ARTIST=Dream Theater
to folder name:
Dream Theater (Awake)