core.saveOutputAs() flushes the output written so far to the indicated file. However, in my experiments, I found that the path of the indicated file is not respected so that the file ends up in the user data directory as well. // vi: ft=javascript
core.output('First line');
core.output('Second line');
core.saveOutputAs('c:\\users\\rene\\stellarium.out');
core.output('Third line');