In addition to what @ernstlx said, you might want to have a look at the Writing a File Naming Script tutorial in the Picard User Guide. It doesn’t cover your situation exactly, but it provides an explanation of how and why to do some things in the script.
Also note that %catalognumber% is a multi-value tag which may contain more than one entry, if there were multiple labels involved in the release and each assigned a catalog number (or no number at all). Depending on what you’re looking for you might want to use the $getmulti() function in addition to the $if2() function to get an appropriate response.
Thanks! This mostly works, I recently removed the originalyear tag from most of my files. So I have the original date field to work off of. this modification seems to resolve that.
But I would consider at least with %releasecountry% that the tag could be empty.
if2(%releasecountry%,XW) ← worldwide if not given
This one, as well as %catalognumber% (mentioned by @rdswift), may have more than one value. Without further ado, the first value would be chosen.
For %catalognumber%, I’d want the first value only, so I can keep as is it seems. EDIT: I tried it and it seems to pull all in. Does the $getmulti allow for only the first value to be pulled in? I had a hard time following the linked info. Programming was not my strong suit in college.
Good call on the release country, I will add that.
Makes sense now, thanks! I was for some reason trying to use the 1 for index vs the 0.
I’ll have to think if I want multiple values or not for that one. Sometimes the one I want to use is 1st in the string and sometimes it is 2nd.. And using them all will lead to a lengthy folder names. Maybe write both and then manually remove the one I don’t want. Since they are not consistently ordered…
If there is some sort of format to your preferred one, then you can check and use that one, otherwise take the first one in the list. If you can give me examples of the format you prefer, I can help you write the script to try to automate their selection.
EDIT: If you could provide examples in order of preference (assuming there may be more than one), we could try setting up the selection in that order.
Okay, try the following, which should prefer catalog numbers that don’t start with a digit. If there are none that meet the criteria, then it will fall back to the first catalog number in the list.
When I have files loaded in Picard, is there an easy way to move them to Foobar2000? If I select open in player with 12 files, it will open each file one at a time and in the end I am just left with Foobar playing the last file. I’d like to load them to Foobar so I can do a few final edits. Thanks!
Kind of…. If you drag 1 track it will load fine. If you drag multiple files at once it will quickly play (milliseconds) each song and remove it from the interface until the last song, which stays and plays fine as it should.
I’ve ran into a bit of a challenge on multi CD releases. This current script will put all tracks in 1 folder, so I end up with 2 track 1’s, 2 track 2’s, etc.
Is there a way to incorporate an if statement that looks at totaldiscs and creates subfolders for each CD in the set? CD1, CD2, etc. and when files are processed they are saved to the appropriate folder.
But if there is only 1 CD, no subfolders are created, just reverts back to the current script.