I have a post-process function/script that can run from my DAW, inside its audio mixdown dialog. After export completes the script runs and launches Mp3tag with that resulting output file listed. I can then edit/save any metadata/tags on that file. So far, so good.
I actually would like to run several such outputs from my DAW first, with different mixes/song filenames and as such, have them load (via the script) into the SAME INSTANCE of Mp3tag.
What happens right now, at the end of each subsequent 'export', the script runs and Mp3tag launches but with the latest output file listed, the previous one being replaced. So, any metadata/tags info I edited before, is 'lost'.
I've seen the Feature Request topic about having an 'Add Files' button, which also explains how you can add single files to the list by dragging and using CTRL before mouse release. Can't see that this covers what I need here...
Hope I've explained things ok...
I think it would make a great additional workflow improvement (allowing files to be 'added' to an existing list, without dragging/using modifier keys etc...)
In the meantime until such a Feature Request will be accepted and implemented, you could change your script to write a playlistlist .m3u file.
At the very end of your process, you could load such a playlist file (containing a path to all your files to process) and load them in Mp3tag.
Use this in combination with /fp or /fn to add files to the file list. Please note, that files are not automatically sorted when added to the file list.
Thank you - I did have a think about PlayLists, but didn't dive in too deep. And yes, as you say in the meantime, this could be fruitful. Will look into it.
I'm no programmer/script king.! Don't know where it would be right/correct to place the /add command, such that on subsequent exports, those are 'added' to the list in Mp3tag...
Hi - and thanks for your attention too..! See above my other post with a section of the script that runs... I will look more into the docs you posted...
Couldn't wait... thought you were on to something there...
Sadly, all it does now is launch and list the first export ok. But any subsequent export is ignored.! Mp3tag opens, but with only that same original file listed.
(Subsequent exported file(s) are all output fine and stored in the designated folder - nothings getting 'trashed').
I'll have a look into the PlayList mechanism a bit more (how/when they're created and loaded, etc...)
What kind of script-language do you use?
The above section seems to be XML data.
But how to do you read this content and process it?
It depends on the language how you have to escape for example the double-quotes around $PATH.
And if your $PATH contains a the full directory path only (without the filename), then you can try to use /add /fn: instead of /add /fp: as mentioned in the already linked documentation.
I just experimented with a batch file which calls MP3tag a couple of times - and that worked if called from the command prompt. So I would think the playlist is better
Experiments #2:
The batch file with /add and /fn: work if MP3tag is already running.
If MP3tag is closed, the batch file calls a separate instance of MP3tag for each file in sequence.
So the best appoach would be:
Check the syntax in the process file to call MP3tag in the /add fashion.
Make sure that MP3tag is already running when you call your process file.
Thanks again everyone for your time and helpful clues.!
You are correct - it is XML data. The 'script' is automatically called/run (user selectable) by the host DAW, at the end of its export audio process. To my knowledge there is no Command Line involved, for example.
Thank you.! Using this syntax does work (see below). Excellent...
Seems this isn't crucial. With it already open, I run an export, yet the output file from the DAW doesn't load into the list (Mp3tag does come to the 'front' though).
However, if I now close Mp3tag and run the task again (with a new increment number filename), Mp3tag opens as expected, but now with BOTH files listed.! Weird... And, after closing Mp3tag again, running an export once more from the DAW, Mp3tag opens and now includes all three files. Brilliant.!
Some more testing needed, but this may have cracked it for me for now.
Much appreciated.!
For reference, here's the full XML script I'm now using, that the host DAW calls...
I think that the correct syntax would be: <Argument>/add /fn:"$PATH"</Argument>
I left out the colon in my initial suggestion, sorry.
Perhaps it works even better with that modification
For anyone wondering how you could achieve this in Python, this is the code I use in lyrict to open specific tracks in Mp3tag:
# Open only songs with matching lyrics in mp3tag via CLI
def add_to_mp3tag(match_categories, first_track=True):
for ext in match_categories.keys():
for track in match_categories[ext]:
if first_track:
try:
subprocess.Popen(["mp3tag", "/fn:" + track])
except subprocess.CalledProcessError:
print(f"Error while opening {track} in mp3tag.")
first_track = False
sleep(1)
else:
try:
subprocess.run(["mp3tag", "/add", "/fn:" + track])
except subprocess.CalledProcessError:
print(f"Error while adding {track} to mp3tag.")
return
The "sleep" command waits a second for Mp3tag to open if it's not already open. If your PC is slow you might need to extend this time.
I just wish the CLI options of Mp3tag included the option to pass it a list of file paths instead of adding one song at a time. Adding the same folder to Mp3tag by dragging it into the window is orders of magnitude quicker than adding the individual tracks via the CLI from a script.
You can do that this way:
Just use a playlist including a list of file paths and pass this playlist to Mp3tag.exe.
(Of course you have to write such a playlist first, but this should not be too complicated to achieve in your script.)
Interesting, thanks for the idea! The CLI documentation doesn't mention what kind of files are supported, so I erroneously assumed only music files were supported.
So mp3tag "/fn:playlist.m3u8" would work? I'll have to try this when I finish my other project. Edit: Just tested it and it works. Lovely.