Name of Export Output File

What variable will give me the name of the Export output file?

I would like to include the name of the output file that my export script is creating in the first line of that file. How do I get that name?

Bill

These alternatives:
either you have set the filename in the export script with e.g. $filename(%genre%.m3u) - then this one will be taken
or you set it in the export dialogue - this overwrites the default export name which is set in
Tools>Options>Export>Name of the export file.

So actually, there is no variable for this, but you have options to design that entry for yourself.

My plan is to name the output file in the export dialog. So, how do I get to that filename? I don't understand what you mean by "you have options to design that entry for yourself".

There are 3 ways to assign a filename (Tools>Options>Export or File>Export-Dialogue or $filename() specification in the script).
Depending on the way you do it, you can set the same specification into the export script.

There is no predefined variable, which can tell about the filepathname of the currently executed export script, but it would be nice to have such Mp3tag system variable at hand.
You have to create such output for yourself within the export script.
See attached example MTE script.
__Export.Template.mte (1.77 KB)

DD.20160310.1105.CET

__Export.Template.mte (1.77 KB)

Thank you to ohrenkino and DetlevD for your replies. Since there is no way to obtain the output filename, I will need to think again about what to put as the header for the output.
Bill

I still don't understand: as you define the filename, it should be possible to modify a script so that it gets the same knowledge.
Where do you set the filename?
In Options?
In the report dialogue?
In the $filename() function?

My plan is to set the filename in the Export dialog box. So, if I am producing a list of all my classical music albums, I might set the filename to C:\Bill\Music\Classical. I would then like to get the name of that output file (Classical.txt). I would like the first line of that output file to be a header that says something like "This is a list of Bill's Classical music."

e.g. you can set the filename-definition in the script to
$filename(%genre%.txt)

If the GENRE is Classical then MP3tag would suggest the name "Classical.txt" in the export dialogue.
And you could add a header in the export script:
$filename(%genre%.txt)This is Bill's %genre% music

That's a good idea and it would work for me most of the time. However, there might be situations where it does not work. I am copying my mp3 music files onto CDs to play in my car. Some of my genre will need more than one disc, so I planned to label them "Classical Disc 1", "Classical Disc 2", etc. and other discs might have more than one genre. Your suggestion will be a good start though.