title: grails console failing to execute a script after it's opened as .groovy
body: <p>I am using the grails console to test my code as I'm finding it very unproductive to run even basic unit tests efficiently from STS.</p>
  
  <p>Anyway, when I cut and paste the code into the console it runs fine. However when I save the code snippet as a .groovy script and then reopen it later and try and run it, it fails with a generic:</p>
  
  <pre><code>groovy.lang.MissingPropertyException: No such property: xxx for class: yyy
  </code></pre>
  
  <p>The script runs fine if I copy the code and paste into into a new window!</p>
  
  <p>Any idea why this might be happening?</p>