1

Every time I get to work I have to startup 6 local servers. It would be amazing to have one script that starts up these processes in their respective tab.

So it would come done to something like: echo 'Starting server' open new tab cd to directory (ex. /project company/back-end/server)) run startup command (ex. node server.js)

I'm quite new and the examples with bash or applescript didn;t work for me.

BTW: there's an space in the cd directory names, I read that it's different then?

  • Spaces should be backslash-escaped on the command line like `/project\ company/back-end/server`. You can have these commands run in the background via `&` or `cron`, run in a bunch of viewable terminals with something like `tmux`, via one script that does everything else, or a host of other options. You question as it stands is too vague to be a good question on this site; you would be better off doing some research and showing what you've tried before posting here, and defining your question in a much more narrow manner. – jeremysprofile Nov 11 '19 at 19:55
  • 1
    Not exactly tabs, but I feel like tmux can handle something like this. Once you familiarize yourself with a few basic commands, you would be able to use a script such this: https://unix.stackexchange.com/a/355165/226626 Tmux primer (not really neccesary to set up a workflow like this): https://tmuxcheatsheet.com/ – mttpgn Nov 11 '19 at 19:57
  • this could be help you: [https://stackoverflow.com/questions/7171725/open-new-terminal-tab-from-command-line-mac-os-x](https://stackoverflow.com/questions/7171725/open-new-terminal-tab-from-command-line-mac-os-x) – Rogelio Prieto Nov 11 '19 at 20:48
  • Question: do you need the terminal windows open for some particular reason? It seems to me it would be easier to run the commands from AppleScript in the background, and skip the whole 'Terminal' headache. – Ted Wrigley Nov 11 '19 at 21:14
  • @TedWrigley yeah, having them open shows logs and errors – f5172c0d83892c41b60de3f1fadd89 Nov 19 '19 at 11:02

0 Answers0