My script looks like this, really simple
tell application "Terminal"
do script "cd myapp"
do script "heroku console" in window 1
do script "User.count" in window 1
end tell
But I get an "Error in the AppleEvent Routine". What is wrong with this script? If I type the commands in the Terminal it works.