I am storing a list of genres using commas as the delimiter. I wish to add (maybe remove) a genre - in bulk - from the currently visible/selected view of tracks; yet most importantly, I do not want a genre to be duplicated!
Do I do this using filters or action groups? I understand things work a little differently with the Mac version.
What expressions//scripts can I use? Thanks in advance.
The genre selection list only writes a single genre. If you want to add multiple genres this will need to be done manually. You can use the existing genre field and add to it using actions, but not much point if you need to spend as much time writing the action in the first place.
BTW - a comma isn’t generally the best solution for a delimiter as that character often appears in other tag fields. I suggest you might consider a more unique Unicode character as the separator, or at least the more traditionally used semicolon ; or forward slash / as a better choice.
You can also use a dedicated action combined with a filter.
Filtering for
NOT genre HAS "Rock"
would list all files which don't have "Rock" in the genre field. Then, applying an action Format tag field for field GENRE with [%genre%, ]Rock would append the genre "Rock" to a possible existing genre.
You can use two actions Replace for field GENRE with
, Rock and
Rock
replaced by nothing (equivalent to removing) to remove the genre "Rock" from a possibly comma-delimited list of genres.
Yes, in the end you have to use that rather complicated regular expression that only remove duplicates.
So, if you do not have duplicates, then you don't have to dig into that thread.
To replace commas with semicoli, use an action of the type "Replace" (without regular expression)
This only works when you are using multiple and separate fields for the same tag. In your example I believe you are using just one tag separating a list of genres with a comma or semicolon. So these actions don’t apply.
I think that what was covered in the links above. You would have to change the separator to use the semicolon if you made that change to your genre tags already. But regex is not my strength, maybe one of the other users can help. But this is not a simple action using any of the defined tools.
OK, I managed to modify the aforementioned regex to work with semicolons by replacing the colons. It seems to work by only keep the last instance of the word (which is fine enough).