How do I loop thru all of the tags for a given song

Hello,

I am attempting to write a script that loops thru all of the tags for a given song. I have tried 2 different foreach loops and only get “Tagname =” in the log file. I am starting to think that _taglist is not valid. If someone could point me in the right direction it would be appreciated. Below are the two foreach loops I have tried.

$foreach(%_taglist%,
$logline( Tagname = $get(%_loop_value%) $get(%_loop_count%))
)
)

$foreach(_taglist,tag,
$set(_values,%tag%)
$foreach(_values,val,
$logline(Tagname = $get(tag) $get(val))
)
)

After additional research I determined that there appears to not be a built-in variable _taglist containing all of the tag values. So I created a multi value variable with $setmulti and used it to loop through the tag names it contained. Another thing I learned is that multi value variables do not like carriage return line feeds between elements (I do not know if you can include carriage return linefeed as the element separator). I added a conditional test just to see if I could make it work. Below is the updated code.

$setmulti(_tag_list,artist; title; albumartist)

$foreach(%_tag_list%,

$logline(Tag: %_loop_value% = $get(%_loop_value%))

$logline(Count: %_loop_count%)

$if($eq(%_loop_value%,title), $set(%_loop_value%,Test))

)

$unset(_tag_list)