Adding file type or bit rate to Folder name (IF function)

Hi. I'm a new user to MP3Tag and I'm trying to figure out how to rename my folders a certain way. I've created an action with the default value of "_DIRECTORY" and then trying to use a format string for the naming convention.

Basically what I want to do is have the folder name be "Year - Album [FLAC or Bitrate)

I want to do this so that if the file is FLAC, it obviously shows FLAC. But if it's an MP3, I want it to show the bitrate. So I'm assuming this is done using an IF function, but I can't get it right. I've played around with a bunch of variations (few below) but I keep getting errors and I'm obviously not a coder. :slight_smile:

I based this off the $if(x,y,z) if x is true, y is returned, otherwise z

%year% - %album% $if(%_extension%=flac,%_extention,%_bitrate%)

%year% - %album% $if(%_extension%=flac,FLAC,%_bitrate%)

%year% - %album% $if($eql(%_extension% IS 'flac'),%_extention,%bitrate%)

%year% - %album% $if($eql(%_extension%, 'flac'),FLAC,%bitrate%)

I can get Year - Album [%_extention] to work perfectly, but I'm lost of the IF statement and can't get it work. Is this even possible? Any advise would be greatly appreciated.

THANKS!!
Linus

THis is almost right

Try
%year% - %album% $if($eql(%_extension%,flac),FLAC,%_bitrate%)

Wow, that was fast. THANK YOU so much!! And this is why I stick to graphics and not coding :smiley:

You're the man.

Here is what I ended up with.

%year% - %album% $if($eql(%_extension%,flac),'(FLAC)','('%_bitrate%'kbps)')

Example of what you the outcome is:

1994 - The Downward Spiral (FLAC)
or
1994 - The Downward Spiral (320kbps)