Skip to content

Instantly share code, notes, and snippets.

@stammy
Created October 14, 2010 22:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stammy/627190 to your computer and use it in GitHub Desktop.
Save stammy/627190 to your computer and use it in GitHub Desktop.
Launch a series of commands in new OS X Terminal tabs
-- How to use: you can either run manually in applescript editor or open Automator
-- and select run applescript and paste this code where it tells you
-- then save that automation as an application. pro tip: go to sys prefs, accounts, login items
-- and add it there to launch on boot :)
-- provide the commands you want to open here.
-- want to run multiple in the same tab? just use a semicolon to separate the commands
-- these are just dummy commands. i usually launch redis-server, tail my error log, launch sass, and do a git status on my project dir
set commands to {"ls", "pwd", "cd /Users/Stammy/something/secret/web/css; sass --watch site.sass:site.css"}
activate application "Terminal"
repeat with com in commands
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down
-- delay necessary or no worky bc too fast for terminal #sadpanda
delay 0.5
tell application "Terminal"
do script with command com in the last tab of window 1
end tell
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment