A way to automatically save script output to a file

Is it possible to have the script output to automatically save each output to a specific text file(or new file based on current time)? For example, we can use "DOpus.OutputString" in a code to print something to the log. Is there something similar to be able to print something to a text or csv file on computer? It would be a variation of something that can be done manually by clearing the current log before each operation and then saving it to some location. But can that be embedded into a code/button in some way?

You'd probably need to script that yourself. Alternatively, there is something ready to use in the ScriptWizard addin.
ScriptWizard logs to console and file at the same time, limiting log file size and supporting several other logging related features.
It might be overkill for your purpose, but still worth a look or two.

Your right, it is a bit of overkill after looking into it a bit. I thought something like mentioned here (morgantechspace.com/2015/07/ ... -file.html) would do the job but there are errors related to objFSO so I thought there maybe some Dopus function for that instead. Anyway, this is not worth much if it's more complex than a small code.

The actual part to write a line of text to a file is quite simple.
var fso = new ActiveXObject("Scripting.FilesystemObject");
var file = fso.OpenTextFile("c:\mylog.txt", 8, false);
if (file) file.WriteLine("My LogOutput..");
if (file) file.Close();

Don't nail me on the correctness of the parameters passed to OpenTextFile(), but that's it basically. What increases the number of lines in the implementation in ScriptWizard is the support for intendation, log levels, buffering, patterns for dynamic filenames and such.

You could also try the XLog script addin helper I made, it's quite a good start to get a nifty little file logging function.
It already has loglevels, indendation and some other stuff built in, what's missing is writing out to files, find a description here:

Very cool,! Ill check it out. Thanks.