Newbie wants basic scripting help


#1

Hi All,

I've just got into the scripting side of Mp3tag, and I currently use the following

F:\My Music\Artist\Artist - 'Album' - tracknn - title

for which I am using the following format string:

F:\My Music\%artist%\%artist% -
$iflonger(%album%,1,$char(39)%album%$char(39),$char(39)No
Album$char(39)) - $ifgreater(%track%,-1,track$num(%track%,2),00) -
$iflonger(%title%,1,$caps($validate(%title%,_)),track%track%)

the $ifgreater is to check for the absence of a track number, and the
$iflongers are to check for the absence of a track name or an album name.

Reading the forum, I can see that the scripting language has more features than mentioned in Florian's basic help examples.

Is there a website that lists ALL the syntax for the scripting functions?


#2

Instead of your $iflonger() construct, you can use the $if2() function: $if2(''%artist%'',''No Artist''). If an artist field is set, my example returns 'Artist', otherwise it returns 'No Artist'. In the code you have to use the apostrophe twice in order for Mp3tag to see it as literal apostrophe.

http://help.mp3tag.de/en/main_scripting.html contains most scripting functions, but not all (if2() is not listed there probably because Florian didn't have the time to update the help file).


#3

Thanks for the response Sebastian, and I will utilise the if2() construct. But if this wasn't in the helpfile, then how did you know about it?!?


#4

Mp3tag supports a lot of foobar2000's scripting functions. :slight_smile:

http://wiki.hydrogenaudio.org/index.php?ti...ce#Control_flow


#5

I've added it to the help file. Thanks for pointing.

Best regards,
Florian


#6

While at it, could you also update the online help, Florian? The actions page for example doesn't list the new album cover related action types. :slight_smile:


#7

Done! :slight_smile: