You can't, at least not directly.
What you can do, though, is use a script to access the metadata string (via
this.metadata) and then write it out to a text file by creating a data
object and exporting it.
var r = new Report();
I also found the code that must create new next file, but it doesn't work:
var filePath = 'C:/Temp/filename.txt';
var fileSysObj = new ActiveXObject('Scripting.FileSystemObject');
Thank you for your hepl!
The code you found in the second part is not applicable here. You need to
have a look at the createDataObject and exportDataObject methods to achieve