Help with if function


#1

Hello.
How can I do this the next:
I have in the tag the field "WWW ARTIST" and I want to format it to "WWWARTIST", but only if WWW ARTIST is not empty or missing.
I appreciate any help.
Cheers.


#2
Begin Action Group 20110521.pepe murillo.WWWARTIST

Action #1
Actiontype 5: Format value
Field: WWWARTIST
Formatstring: %WWW÷ARTIST%

Action #2
Actiontype 9: Remove fields
Fields to remove (semicolon separated): WWW÷ARTIST

Note: Replace each special ÷ character with one space character.
End Action Group 20110521.pepe murillo.WWWARTIST (2 Actions)

DD.20110521.1957.CEST


#3

Yeah thanks, but as I say before, only do this 2 actions if the "WWW ARTIST" is not empty and exist.


#4

I rely on the miraculous Mp3tag and assume, that this requested optimizing is done by Mp3tag internally ... well ... for action #1 of course ... action #2 will be executed, anyway.

Hmm ... is your intention ... to prevent overwriting resp. removing the possibly existing content in the tag-field WWWARTIST?
You didn't say that explicitly, but such situation would be the only reasonable background for your request, isn't it so?

Try this ...

Begin Action Group 20110521.pepe murillo.WWWARTIST.1

Action #1
Actiontype 5: Format value
Field: WWWARTIST
Formatstring: $if2(%WWW÷ARTIST%,%WWWARTIST%)

Action #2
Actiontype 9: Remove fields
Fields to remove (semicolon separated): WWW÷ARTIST

Note: Replace each special ÷ character with one space character.
End Action Group 20110521.pepe murillo.WWWARTIST (2 Actions)

... or maybe this ...

Begin Action Group 20110521.pepe murillo.WWWARTIST.2

Action #1
Actiontype 7: Import tag fields (guess values)
Source format: $if2(%WWW÷ARTIST%,%WWWARTIST%)===%DUMMY%
Guessing pattern: %WWWARTIST%===%WWW÷ARTIST%

Note: Replace each special ÷ character with one space character.
End Action Group 20110521.pepe murillo.WWWARTIST (1) (1 Action)

DD.20110522.2013.CEST


#5

I don't understand why this is so complicated. Mp3tag will never create empty fields (and if you set a field to a null string, it will be removed, not left empty). So it's simply:

Action type: Format value
Field: WWWARTIST
Format string: %www artist%


#6

If I do this and the WWW ARTIST is empty or doesn't exist, the WWWARTIST (even if exist) just dissapear. I did the test already.


#7

You failed to mention that WWWARTIST may already exist. You should state the problem completely. In the meantime, maybe you want:

Action type: Format value
Field: WWWARTIST
Format string: $if2(%www artist%,%wwwartist%)


#8

Action #1
Actiontype 5: Format value
Field: WWWARTIST
Formatstring: $if2(%WWW÷ARTIST%,%WWWARTIST%)

THanks, this action do like I want it.