title: How to save output from groovyconsole in a file?
body: <p>I have installed groovyconsole in AEM and have bunch of stuff that I would like to save in a file as output.</p>
  
  <p>Following <a href="https://hashimkhan.in/aem-adobecq5-code-templates/groovy-script/" rel="nofollow noreferrer">this</a> post, I tried:</p>
  
  <pre><code>def filePath = "/content/corporate/reports/output.csv"
  File output = new File(filePath)
  
  output.append('Hello world!')
  </code></pre>
  
  <p>I end up getting a FileNotFoundException. I created the file directly just to make sure, but that too didn't help.</p>
  
  <p>Would appreciate some heads up on this. Thanks.</p>