First time using this software. I was trying to find (open source) get-tag-from-filename software that could replace underscores with spaces and capitalise the 1st word. The former is a default option, the latter can be added through plugins. Or so it seemed. I installed 3 plugins, none seem to work:
Padded disc and tracknumbers, Smart Title Case, and Title Case (I tried 2 and 3 separate, and together). They have the green check mark, so they should work automatically, right? But when I add a folder, select the files and then try to use the âconvert file name to tagsâ, none of the plugins do anything. The filenames are formatted like this: â01-title_of_track.extensionâ. Tracknumbers are still 1-9 (in stead of 01-09), words are still all lower case. Am I doing something wrong?
Using v2.7.3 on Win10.
Maybe itâs just me not understanding, but youâre not giving us much to work with. You need to be a bit more specific about what youâre trying to do, and how youâre doing it. For example, are you renaming your files or trying to add tags based on the filename (or both)? What is the workflow process that youâre following (step-by-step)? What file naming and tagging scripts are you using? Are you matching the files up with release information retrieved from MusicBrainz or just using the information from the existing file names? What matching pattern are you using for parsing the file names (see the Generating tags from file names section of the documentation)? What are a couple of examples of your current file names, and the corresponding desired new filename?
Note that the plugins are typically only applied to information when it is retrieved from MusicBrainz, and not with tags developed from existing file names. Also, I assume that you have the âRename files when savingâ option enabled in the File Naming Options settings page.
Based on my current understanding (guess) of your situation, I suspect that your file name matching pattern should be something like:
%tracknumber%-%title%
with the âReplace underscores with spacesâ option enabled, and your file naming script should look something like:
$num(%tracknumber%,2) $title(%title%)
In this case, there should be no need for any plugins.
2 Likes
I thought it was pretty clear from my description (as Iâm trying something very basic), but Iâll try to elaborate.
I want to tag files (tag the title) based on file name. Files are formatted like â01-title_of_track.extensionâ. I donât want to rename files. (So the ârename files when savingâ option is irrelevant.) Iâm not using any database or scripts.
Step 1: enable 2 plugins (Padded titles, Smart Title Case)
Step 2: add folder (ctrl+e)
Step 3: select all files
Step 4: ctrl+shift+t
Step 5*: use %tracknumber%-%title%, with âreplace underscores with spacesâ checked
- â$num(%tracknumber%,2) $title(%title%)â does not work (Iâm guessing this only works for scripts).
Result: plugins are not used, resulting tracknumber and title tags are â1â and âtitle of trackâ, where I was expecting â01â and âTitle Of Trackâ.
So that might be the problem then. (Sounds like something that could be mentioned on the documentation page.)
It looks like Picard isnât the simple solution I was looking for. But I can try and write a simple tagging script, that shouldnât be too hard. (If I can find out how to use part of the filename.)
Okay, try thisâŚ
First create a tagging script containing:
$set(tracknumber,$num(%tracknumber%,2))
$set(title,$title(%title%))
and save with a name such as âFix Number and Titleâ. This only needs to be done once.
Then following your steps:
Step 1 not needed.
Steps 2-5 as you have shown.
Add the following steps:
Step 6: Select the files to fix (They may already still be selected in your Step 3.)
Step 7: Right-click the cluster (group) or individual files and choose âRun scriptsâŚâ, selecting the script you created above.
This should change the tags according to the instructions in the script. This can be verified by looking at the tag information in the lower portion of the window. If everything looks okay, you can then save the files with the new tags.
Iâm not sure how the tracknumber is saved, so itâs possible that the leading zeros will be stripped out, but I think they will be okay.
2 Likes
That did the trick (except the 1st line should of course be â$set(tracknumber,$num(%tracknumber%,2))â). And as you mentioned, plugins are now not needed.
I was trying to do this all in 1 step from a single script in which case youâd need a way to select part of the %_filename% variable, I donât know if thatâs possible, but I havenât figured this out. Anyway, this works, thanks!
1 Like
Script-only version:
$set(tracknumber,$left(%_filename%,2))
$set(title,$title($replace($substr(%filename%,3,255),, ))))
Note: the documentation suggests that the $substr function works with (1 or) 2 arguments, but Picard doesnât allow this: âWrong number of arguments for $substr: Expected exactly 3, got 2â
Edit: you can also leave out the 3rd argument but keep the comma i.e. only delete â255â