ZITAT(m4rk @ Feb 22 2012, 12:03)

Is there a help section to explain how the looping part works? I didn't see it in 'scripting' help section?
yes, in the export help section
http://help.mp3tag.de/options_export.html#syntax :
ZITAT
$loop(%fieldname%) starts a new loop. The loop data is sorted by the fieldname.
$loopend() ends a loop.
If you want to limit the loop output to a certain number of entries, simply use $loop(%fieldname%,num). This is useful to eliminate duplicate records (num=1).
So if you have something like
QUELLTEXT
$loop(%_filename_ext%)%title%;%artist%;%album%;
$loopend()
the loop writes %title%;%artist%;%album%; + linebreak for every new %_filename_ext%.
Whereas this loop
QUELLTEXT
$loop(%album%)%albumartist%;%album%;%year%
$loopend()
would write %albumartist%;%album%;%year% + linebreak for every new %album%. So it would skip all files with the same %album% value after writing the values of the first file.