Script for export to nfo with Loop Funktion - Counting multiple entries divided by Comma

Hello Forum,

I try to get some simple *.nfo files with the Export function. Everything works well until I have multiple tag fields divided by Comma like %actors% %artists% or %Genre%.

Heres how it should look like (created by metaX)

<?xml version="1.0" encoding="utf-16"?>

  • MetaX for Windows*
  • Top Gun*
  • Top Gun*
  • Top Gun*
  • 1986*
  • *
  • *
  • 110 min.*
  • *
  • Tony Scott*
  • *
  •   <name>Tom Cruise</name>*
  • *
  • *
  •   <name>Val Kilmer</name>*
  • *
  • *
  •   <name>Kelly McGillis</name>*
  • *
  • *
  •   <name>Meg Ryan</name>*
  • *
  • *
  •   <name>Anthony Edwards</name>*
  • *
  • *
  •   <name>Michael Iroside</name>*
  • *

seems the scrip here counts all Commas in the field actor(s) and makes for each Name a new Entree.

So far the export result of my script looks like this:

  • Top Gun*
  • 1986*
  • Krieg;Abenteuer;Love Story*
  • *
  • Tony Scott*
  • Paramount*
  • Tom Cruise,Val Kilmer,Kelly McGillis,Meg Ryan,Anthony Edwards,Michael Iroside*

I think I must use the $Loop function here for actors but can find any samples how to set it up right that it counts all commas and puts out 1 entree for each comma.
Tried also someting with " $meta_sep" but also no success

Thx for your help and Suggestions.


That is very hard to tell as I do not see anything from the script.

What did you try? An actual example would help.

Hello, thx for your help.

I have for example in the tag field actor multiple entrees divided by"," like Tom Cruies,Kelly McGillis,Meg Ryan

in the exported nfo file it should look like:

but all I can get so far is:

the script is so far:

But how do I manage that nfo looks like in first picture with each actor seperated ?


Please show us your producing script (the one with the $loop and $meta_sep commands).

Sorry, for $Loop I just tried to modify a Loop function I found here on the forum but it didnt work and was not for comma divided multitag field used.

About the sept funktions I only read on the wiki, I thought that was a solution for my problem....

But didnt work either...or more like I have no clue how to do it.

You could try an expression like
<actor>$replace('Tom Cruies,Kelly McGillis,Meg Ryan',',',</actor><actor>)</actor>
for the line where you write the actor.
Instead of the string constant 'Tom Cruies,Kelly McGillis,Meg Ryan' it should be possible to use $meta_sep(actors,',')

So far your suggestion works great...

but my zidoo player needs the "name thing" arround to read out the different actors.

like here

So it's not just

Ok, coooool!

but the first name isnt covered with"Name" cause the tag-field doesnt start with a comma I guess ?


Ok, I tried on my Zidoo: No sucess to retrieve the Actors. I put them in lines like MetaX does. Added the name opener for first actor and name closer for last actor by hand and than it worked by Zidoo !!

So in the script I have handle the opener closer for name tag for the first and last Actor in the tag
2nd I need to seperate them in lines like on the picture by the script....


You are missing the opening part <actor><name> in front of the $Replace() statement and the corresponding closing part.

Thank you very much Ohrenkino...Vielen Dank. It works fine now. And all Actors are displayed seperately in the player.

But one last thing...

When I run the exportfunction in a script for tagging and exporting multiple files / nfos.....

How can I set it up that the nfo will be exported to the sourcefolder of the video with the name of "sourcefolder".nfo or "sourcefilename".nfo ?

All I can specify is a filename and outputfolder in the export funktion. In a script that would overwrite again and again the same nfo file.

instead of a constant filename, use something like

Hello again :slight_smile:

With "%_directory%.nfo"

for "Dateiname der Exportdatei" and "Eine Datei pro Verzeichnis" checked the exported nfo's go all in the Parent Directory and not in the folders where the source media file is.

If I do a search and collect all media files I need and do an nfo export they land all in a parent directory together and it takes ages to find the right folders for the nfo.

No Problem with just 1 file, that lands correct in the source folder.

Thx for help.

As I said:

If that information does not distinguish enough then you have to add further data like
(Again: "like" - it still means that you have to look whether it suits your needs and adapt it accordingly.)