Created
December 6, 2015 07:19
-
-
Save lrdiv/4dfb6b19ed82cbdf5002 to your computer and use it in GitHub Desktop.
Scripting iTerm 2
This file contains hidden or 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
(* Note: `cdnr` and `cdnem` are custom aliases for this project *) | |
tell application "iTerm" | |
(* Creates a new window for our project *) | |
set newWindow to (create window with default profile) | |
select first window | |
tell the current window | |
(* cd to rails directory and start server *) | |
activate current session | |
tell the current session | |
write text "cdnr;" | |
write text "thin start -C dev/thin.yml;" | |
end | |
(* creates a new tab *) | |
set newTab to (create tab with default profile) | |
select last tab | |
(* cd to rails directory and start sidekiq *) | |
tell the current session | |
write text "cdnr;" | |
write text "sidekiq;" | |
end tell | |
(* creates a new tab *) | |
set newTab to (create tab with default profile) | |
select last tab | |
(* cd to ember directory and start server *) | |
tell the current session | |
write text "cdnem;" | |
write text "ember s;" | |
end tell | |
(* creates a new tab *) | |
set newTab to (create tab with default profile) | |
select last tab | |
(* cd to rails directory *) | |
tell the current session | |
write text "cdnr;" | |
write text "clear;" | |
end tell | |
(* creates a new tab *) | |
set newTab to (create tab with default profile) | |
select last tab | |
(* cd to ember directory *) | |
tell the current session | |
write text "cdnem;" | |
write text "clear;" | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The goal of this script is to create a new iTerm window with 5 tabs.
Tab 1) Runs the rails server
Tab 2) Runs sidekiq on the rails server
Tab 3) Runs the ember-cli server
Tab 4) cd to the rails application (for running
bundle install
or rake tasks)Tab 5) cd to the ember application (for running
npm install
orbower install
)