Hi,
if I remember right, you can find an example in our training package for the videos on http://www.vmwarelearning.com/orchestrator you can get from here: http://communities.vmware.com/docs/DOC-21582
The Workflow is called "Save Datacenter Report to html file".
In short:
var myFile = new File(fullPathAndFilename);
myFile.write(something);
Cheers,
Joerg