Automatically opening multiple Apps / TABs for certain projects I'm trying to improve my workflow when working on certain projects. Depending on what kind of work I'm doing, I'll want certain apps open with certain configurations.

Example:

For a web development project, I'll want to open iTerm 2, have 2 horizontal panes. The upper pane will go into the frontend folder, the other one will go into the backend folder. Then, I want to have both folders also open up in Sublime Text.

Ideally, I'd like to have an app or a file or a script or something, that does this for me so that I don't have to do this every time I want to work on whatever project:

- Launch iTerm
- Hit CMD-ENTER for fullscreen
- Hit CMD-SHIFT-D for two horizontal panes
- Run "cd to/project/backend"
- Run "subl src" to open "src" folder in Sublime Text
- Run "vagrant up"
- Close Sublime windows I had open last time I quit it
- Hit CMD-ALT-UP to go to upper pane
- Run "cd to/project/frontend"
- Run "subl ." to open new Sublime window here
- Launch Chrome and open up my frontend in a new tab


That's just one example. When I'm working on something else, I might want Sketch and Keynote open with certain files (no terminal at all).

I'm looking for a way to automate these processes. Grateful for any suggestions. Thank you! :)
I would recommend using a 'boot' shell script to do most of what you're describing and bind it to an iTerm2 profile. You can configure a profile to have a specific window arrangement (it is a feature of iTerm2), see iTerm2 > Preferences > Arrangements to save your current arrangement as a preset.

Then, make a new profile that executes a startup script and applies the aforementioned window arrangement as its default arrangement (iTerm2 > Profiles > Open Profiles > Edit Profiles). Ideally, you would bind launching this profile to a shortcut, like Command + Control + D for one-keystroke access.

In said profile, under the General Tab > Command section, the startup command should be a shell script akin to below:

I don't know why it's necessary for you to open up the sublimetext frontend and backend in different terminal windows. Whenever you run subl, it opens the app as a daemon, as subl is just a python wrapper that launches the OS X app.

Sample rough startup.sh script I scaffolded up for ya:

#!/usr/bin/env bash

cd ~/to/project/backend
open . # open Finder window of backend folder
subl . # open SublimeText instance of backend folder

cd ~/to/project/frontend
open . # open Finder window of frontend folder
subl . # open SublimeText instance of frontend folder

# Launch chrome and navigate to http://localhost:8000/ or wherever your dev location is
open -a "/Applications/Google Chrome.app" 'http://localhost:8000/' 

echo 'COME AT ME BRO'


You should change the settings on SublimeText to not remember your window/tab arrangements from previous launch instead of attempting to script it to close all of your windows from before.

Alternatively, you could have subl open a native, .sublimetext-workspace or .sublimetext-project file and achieve more precise results than with subl .