Boolean script help

Hello there, I recently discovered MP3Tag and I am amazed at how good this program is, still being a n00b however I have a certain problem that I can't figure out how to fix...I've read the help but I still can't wrap my head around it...the problem is the following..

I have a nicely organized music collection and all folders and files are named in the same manner, just my tags have a few issues...basically my entire collection comes down to either compilations or album (as I'm sure most of yours is as well :smiley:)...I would like to be able to have a Filename - Tag format script that can analyze the name of my folders and depending on weather it's a compilation or an album fill out the tags appropriately so I don't have to go through it manually...so the way I have it is:

for albums:
Artist Name - Album Name (Year) - Publisher

and for compilations:
Album Name (Year) - Publisher

track names are all:

  1. Track Artist - Track Name

Also the folder above is always the Genre folder. I have the following script but it's not working:

%genre%$if2(%artist% - %album% (%year%) - %publisher%,%album% (%year%) - %publisher%)\%track%. %artist% - %title%

what am I doing wrong?

Thanks in advance!

"Convert > Filename - Tag" does not support scripting, only simple placeholders.
You must try different approaches:

You can run your album pattern over all files:
%genre%\%artist% - %album% (%year%) - %publisher%\%track%. %artist% - %title%
It should skip all files that don't match it.

Then use the Filter [F3] on _FOLDERPATH with this expression: ^[^-]+-[^-]+$
That will list files that have only one - in their folderpath.
Then use your compilation pattern.

Or make a new column with the value $len($regexp(%_directory%,'[^-]+',))
That gives you the amount of - chars in the directory name so you can sort by this column. You can easily select all album tracks or all compilation tracks now.

thanks a lot mate, that will do for sure, the ability to sort all albums and all compilations is enough, then I can just run the album or compilation pattern

cheers!