I'm hoping someone can help me create an "IF" argument to generate tag fields based upon the structure of the filename, for example:
"K Klass - Rhythm Is A Mystery (Percussion Mix) [Deconstruction]"
Would become:
"Artist - Title (Mix) [Publisher]"
If the [Publisher] is not present then parse as "Artist - Title (Mix)"
I've tried the below using "Import tag fields", the first part is successful but the second part without the publisher fails.
$ifeql($strstr(%_FILENAME%,%DUMMY% - %DUMMY% (%DUMMY%) [%DUMMY%]),0,%ARTIST% - %TITLE% (%MIXARTIST%) [%PUBLISHER%],%ARTIST% - %TITLE% (%MIXARTIST%))
I think that you have to use a filter to get the data from the filenames with different patterns.
e.g.
%_filename% HAS "["
for the ones with the publisher and
NOT %_filename% HAS "["
for the ones without.
Please note that %dummy% only works in matching format strings but the scripting function has to generate a format string first, so that is a generating format string.
You could try an action of the type "Import fields" with
Source: $if($grtr($strstr(%_filename%,'['),0),$regexp(%_filename%,'(.*) - (.*) \((.*)\) \[(.*)\]',$1==$2==$3==$4),$regexp(%_filename%,'(.*) - (.*) \((.*)\)',$1==$2==$3==))
Target format string: %artist%==%title%==%mixartist%==%publisher%
If there is no data in the square brackets, no data i written to %publisher% and as empty fields do not exist, it will not be included in the file.
Thank you very much, that works exactly as expected.
Do you know if there a way to retain the information in the fields containing data that aren't targeted by "%artist%==%title%==%mixartist%==%publisher%", or is this an unfortunate side effect of the process?
The above solution provided by ohrenkino does now indeed work as intended.
I removed all actions I had created and rebuilt them. Just to close off with your post, my tag type settings are set as shown in the screenshot also.