# Name of Export Output File

**URL:** https://community.mp3tag.de/t/name-of-export-output-file/17732
**Category:** Export
**Created:** [March 9, 2016, 12:00am UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732 "2016-03-09T00:00:09Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![billklecka](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@billklecka](https://community.mp3tag.de/u/billklecka)
#### Post date: [March 9, 2016, 12:00am UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/1 "2016-03-09T00:00:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 9, 2016, 5:05am UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/2 "2016-03-09T05:05:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![billklecka](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@billklecka](https://community.mp3tag.de/u/billklecka)
#### Post date: [March 9, 2016, 6:24pm UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/3 "2016-03-09T18:24:16Z")

</div>

> [@ohrenkino](#):
>
> 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  
> File\>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".

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 9, 2016, 6:29pm UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/4 "2016-03-09T18:29:50Z")

</div>

> [@BillK](#):
>
> 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 (File\>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.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 10, 2016, 8:45am UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/5 "2016-03-10T08:45:13Z")

</div>

> [@BillK](#):
>
> 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

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](https://community.mp3tag.de/uploads/default/original/2X/2/2eb7d755aa6b1e75cb7f70073136fcc46bb8bfe4.mte) (1.77 KB)

DD.20160310.1105.CET

[\_\_Export.Template.mte](https://community.mp3tag.de/uploads/default/original/2X/2/2eb7d755aa6b1e75cb7f70073136fcc46bb8bfe4.mte) (1.77 KB)

---

<div class="post-metadata">

### Author: ![billklecka](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@billklecka](https://community.mp3tag.de/u/billklecka)
#### Post date: [March 10, 2016, 4:52pm UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/6 "2016-03-10T16:52:55Z")

</div>

> [@DetlevD](#):
>
> 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](https://community.mp3tag.de/uploads/default/original/2X/2/2eb7d755aa6b1e75cb7f70073136fcc46bb8bfe4.mte) (1.77 KB)
> 
> DD.20160310.1105.CET

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

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 10, 2016, 6:07pm UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/7 "2016-03-10T18:07:37Z")

</div>

> [@BillK](#):
>
> 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?

---

<div class="post-metadata">

### Author: ![billklecka](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@billklecka](https://community.mp3tag.de/u/billklecka)
#### Post date: [March 10, 2016, 6:51pm UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/8 "2016-03-10T18:51:23Z")

</div>

> [@ohrenkino](#):
>
> 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."

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 10, 2016, 7:14pm UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/9 "2016-03-10T19:14:42Z")

</div>

> [@BillK](#):
>
> 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

---

<div class="post-metadata">

### Author: ![billklecka](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@billklecka](https://community.mp3tag.de/u/billklecka)
#### Post date: [March 16, 2016, 5:55pm UTC](https://community.mp3tag.de/t/name-of-export-output-file/17732/10 "2016-03-16T17:55:36Z")

</div>

> [@ohrenkino](#):
>
> 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.
