Make %discnumber% blank under Actions

Long time user, first time poster.

I'm looking to create a formula to force %discnumber% to be blank if the length of discnumber is only 1. The reason I'm looking to do this is because I convert Tag -> Filename using disc numbers if they exist, otherwise just keep with the album name. That formula is:

$if(%discnumber%,%album% (Disc %discnumber%),%album%)

I already have %discnumber% being formatted from 1/2 to "1 of 2", too. That's automatic. The problem I'm facing is:

$if($len(%discnumber=1),, %discnumber%)

is creating an "empty" box rather than a box. Is there a way to do this so I don't have to worry about accidentally blanking a multi-disc set?

You'd need to compare the length of the %discnumber% using the $eql() scripting function. As additional safety measure, I'd directly compare against disc number being "1" and being empty and use this directly in "Tag - Filename":

$if($or($eql($len(%discnumber%),0),$eql(%discnumber%,1)),%album%,%album% (Disc %discnumber%))

If you want to go and blank the field if its length is 1 with an action, you'd need to use

Ah, I was on the right track, just missing a couple of key components. Great, and thanks!

1 Like