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.

Chris

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:
scriptsofar

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

Chris

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....
https://hilfe.mp3tag.de/main_scripting.html

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
</actor><actor>
but
</name></actor><actor><name>

Ok, coooool!

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

script2

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....


2
script

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

:grinning:
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
$filename(%_directory%.nfo,UTF-8)