Write different file structure based on existence of disc tag

All my single disc albums have blank disc tags and get their file structure written from tag using:

_DIRECTORY
%artist%'['%year%']' %album%

For multi disc releases where the discnumber tag is populated, I'd like to write:

%artist%'['%year%']' %album%\%discnumber%

Is there a way to do this? I've been looking through the forums but can't find anything.

This is very unfortunate for you, because the forum is very well stocked with all sorts of interesting contributions.
The $if function is documented in the Mp3tag help manual, section Scripting Functions.

Regarding your example:

$if(%DISCNUMBER%,'do this','do other') $if(%DISCNUMBER%,%ARTIST%'\'['['%YEAR%'] ']%ALBUM%'\'%DISCNUMBER%,%ARTIST%'\'['['%YEAR%'] ']%ALBUM%)

There is also an abbreviated scripting expression, which gives the same result:

%ARTIST%'\'['['%YEAR%'] ']%ALBUM%['\'%DISCNUMBER%]

DD.20110424.1315.CEST

Hi DetlevD
Isn't it also an alternative to reformat the directory with a term in square brackets?

%artist%'['%year%']' %album%\%discnumber%\%title% ->
%artist%'['%year%']' %album%[\%discnumber%]\%title%

Hi ohrenkino, see my 'square bracket clamb' example in post #2, isn't it that what you mean?
But how is your example related to the open poster's question?

DD.20110425.2000.CEST

There must have been at least tomatoes on my eyes (good ole German colloquial ;-))
Thank you for reassuring me.