Last active
December 16, 2015 12:39
-
-
Save gilgen/5436359 to your computer and use it in GitHub Desktop.
Open four tabs into a project directory
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
| -- Set the directory where your projects live | |
| set projectsDirectory to ((path to home folder) as string) & "projects:" | |
| -- Set your editor command | |
| set editorCommand to "mvim" | |
| -- Set your default session name here | |
| set defaultSession to "Default" | |
| tell me | |
| activate | |
| end tell | |
| set project to text returned of (display dialog "Project directory" default answer "") | |
| if project is "" then | |
| display dialog "You didn't give a project" | |
| return | |
| end if | |
| try | |
| set projectPath to projectsDirectory & project as alias | |
| on error | |
| display dialog "That project doesn't exist" | |
| return | |
| end try | |
| tell application "iTerm" | |
| tell (make new terminal) | |
| repeat with i from 1 to 4 by 1 | |
| launch session defaultSession | |
| tell the last session | |
| set name to project | |
| write text "cd " & POSIX path of projectPath | |
| if i is 1 then | |
| write text "echo -e \"\\033]\" & project & \"\\007\"" | |
| write text editorCommand | |
| end if | |
| write text "clear" | |
| if i is 4 then | |
| write text "vagrant up" | |
| end if | |
| end tell | |
| end repeat | |
| end tell | |
| end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment