Created
March 29, 2009 10:01
-
-
Save jacobat/87347 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to maximize for a | |
tell application "Finder" | |
set _b to bounds of window of desktop | |
end tell | |
tell application a | |
set bounds of front window to _b | |
end tell | |
end maximize | |
on execute(cmd, posixPath) | |
tell application "iTerm" | |
set myterm to (the first terminal) | |
tell myterm | |
set mysession to (current session) | |
tell mysession | |
set name to cmd | |
write text "cd " & posixPath | |
write text cmd | |
end tell | |
end tell | |
end tell | |
end execute | |
on executeNew(cmd, posixPath) | |
tell application "iTerm" | |
set myterm to (the first terminal) | |
tell myterm | |
launch session "DefaultSession" | |
set mysession to (last session) | |
tell mysession | |
set name to cmd | |
write text "cd " & posixPath | |
write text cmd | |
end tell | |
end tell | |
end tell | |
end execute | |
to openTermIn(posixPath) | |
tell application "iTerm" | |
set myterm to (the first terminal) | |
tell myterm | |
launch session "DefaultSession" | |
set mysession to (last session) | |
tell mysession | |
set name to "terminal" | |
write text "cd " & posixPath | |
end tell | |
end tell | |
end tell | |
end openTermIn | |
on run argv | |
set posixPath to item 1 of argv | |
execute("ruby script/server", posixPath) | |
executeNew("ruby script/console", posixPath) | |
executeNew("tail -f log/development.log", posixPath) | |
openTermIn(posixPath) | |
tell application "TextMate" | |
open posixPath | |
end tell | |
maximize for "Textmate" | |
end run | |
----------------- | |
To compile: | |
osacompile -o startrails.scpt startrails.applescript | |
----------------- | |
To run: | |
osascript startrails.scpt /path/to/rails/project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment