Skip to content

Instantly share code, notes, and snippets.

@ryancoughlin
Last active December 19, 2015 17:29
Show Gist options
  • Save ryancoughlin/5991858 to your computer and use it in GitHub Desktop.
Save ryancoughlin/5991858 to your computer and use it in GitHub Desktop.
property git_repo : "Documents/m/"
on newTab(tabTitle, command)
tell application "iTerm" to tell first terminal
launch session "Default"
tell last session
write text "cd " & git_repo
write text command
set name to tabTitle
end tell
end tell
end newTab
on isAppRunning(appName)
tell application "System Events" to (name of processes) contains appName
end isAppRunning
if isAppRunning("iTerm") then
tell application "iTerm"
set myterm to (make new terminal)
activate
if (count of terminal) = 0 then make new terminal
my newTab("Get Latest from git", "git fetch")
my newTab("Run Node Server", "node server")
my newTab("Run Compass Watch", "compass watch")
my newTab("Open GitX and Sublime", "gitx && sublime .")
--terminate the fourth session of the first terminal
end tell
else
activate application "iTerm"
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment