Error if Export filename contains an apostrophe

The Export utility generates an error when the Export filename contains an apostrophe. For example, if I specify in the dialog box that the output file should be named "Bill's Output" an error occurs, but "Bills Output" works fine.
The error is that the output filename is changed to "[ SYNTAX ERROR IN FORMATTING STRING ]" and the file is created in the current album's directory rather than the specified directory. However, the contents of that output file is correct.
It took me quite awhile to figure this out, because I thought the error was in the new script that I was writing, but the script always created the correct output. Finally it occurred to me that the error message became the output filename because the error was in the filename.
Because Windows allows an embedded apostrophe in a filename, the Export utility should be able to accept it or at least generate a dialog box with a meaningful explanation of the problem.

The error message lead you to the right conclusion: the filename of the report script is scriptable, like any other formatstring in Mp3tag.
The apostrophe character is a reserved character in Mp3tag and is used to delimit a string of characters.
If you want to see the true apostrophe character, then you have to write it twice.
(bad) Bill's Output ==> (good) Bill''s Output
(bad) Bill's Output ==> (good) 'Bill''''s Output'

Example for MTE file ...

$filename($getEnv('USERPROFILE')'\Desktop\Export.Whatever.txt',UTF-8) $filename($getEnv('USERPROFILE')'\Desktop\Bill''''s Output.txt',UTF-8)

See also ...


Thanks for the sample code and the link to the other topic, which was informative.
I do understand how the single quote works in scripting. However, I did not know that an output filename put into the dialog box became part of the executable code, and I doubt that a casual user would have any understanding of that.
So, I'm encouraging you to modify the code processing engine so that it checks for inappropriate characters in the user provided filename and either gives a warning dialog box or handles them in a way that doesn't produce an error.

See ...

There is a hint, that Mp3tag supports own placeholders for creating the export filename.
Maybe the hint should contain the word "Formatstring" to make it obvious to the reader, ...
that the filename is scriptable and for example the apostrophe character must be written twice to be used as a literal character.

And take into account that the filesystem itself has a set of invalid characters
See ... /t/8311/1.