title: An applescript stopped working after upgrade from snow leopard to lion
body: <p>This script worked every time with Snow Leopard. </p>
  
  <pre><code>tell application "Terminal"
      activate
      do script "cd web_sites/project" in front window   # this line highlighted on error
      do script "mate ." in front window
      do script "rvm 1.8.7" in front window
      do script "script/server" in front window
      delay 4
      do shell script "open -a Firefox http://localhost:3000"
  end tell
  </code></pre>
  
  <p>With Lion I keep getting this error:</p>
  
  <pre><code>error "Terminal got an error: Can’t get window 1." number -1728 from window 1
  </code></pre>
  
  <p>Thanks.</p>