I have been using applescript to open my development environment. No typing… love it. I wonder if everyone is doing this? I put the whole thing here in case there are some other folks who could use it. Anyway, as you can see below, one click…
- opens the console
- changes to my rails app directory
- opens textmate
- changes ruby version using rvm
- starts the rails server
- opens another console tab
- changes to the stylesheet directory
- changes the ruby version
- enters the sass watch command
- then it is supposed to open another console tab (this isn’t working)
- changes directory
- changes ruby version
- delays 4 seconds (to give time for the rails server to fully initiate)
- then opens Firefox to localhost
For some reason the third tab doesn’t open.
tell application "Terminal" activate do script "cd web_sites/railsproject" in front window do script "mate ." in front window do script "rvm 1.9.2" in front window do script "rails server" in front window # THIS NEXT LINE IS NOT WORKING tell application "System Events" to tell process "Terminal" to (keystroke "t" using command down) activate do script "cd web_sites/whozou/public/stylesheets" in front window do script "rvm 1.9.2" in front window do script "sass --watch stylin.scss:stylin.css" in front window tell application "System Events" to tell process "Terminal" to (keystroke "t" using command down) activate do script "cd web_sites/whozou" in front window do script "rvm 1.9.2" in front window delay 4 do shell script "open -a Firefox http://localhost:3000" end tell
I thought about opening another tab in the console to set up my ssh connection to the production server but am wondering about whether leaving the connection open for hours poses a security threat. Not the main question but feel free to comment on this.
Thanks for your help.