I have an action that automatically renames the parent folder based on the metadata of the songs, using the $if function depending on if certain fields are empty. I tried using $trim but it didn't seem to work.
$if(%catalog%,'['%catalog%']',) %album% (%year%) $if(%event%,'['%event%']',) (%_EXTENSION%)
CATALOG and EVENT are custom metadata fields for the songs. It results in a neat folder name such as:
[ACCD2] Acclaims Raving X-Mas (1997) (flac)
However, my problem is that the second half of $if (the "no" else latter half, ",)") is inserting blank spaces in the filename if the metadata field is empty. This is inserting a space at the beginning of the folder name, and inserting a space after the year.
How can I avoid or automatically trim this while running this action? Ideally I don't want to run a separate "remove leading spaces" action after this, I want it all-in-one.
Thanks for any help.