How do I open a second window in terminal?

I'm trying to open two separate terminal windows. Every time I use the open application trigger it opens the same window.

Help much appreciated.

Hi and welcome to the forum!

Cmd-N will open a new window in Terminal. Give that a shot. :+1:t3:

1 Like

Also an AppleScript do script command without referencing a particular window, which could be a time-saver if you already know what you need to do in Terminal or if you want to set the window up in a particular way. For example:
terminalTest

1 Like

Thanks @noisneil,

I guess I should've been clearer though how do I do it through Keyboard Maestro?

I'm aware of the keyboard short cut but I'm not able to recreate that in the application. Any tips there?

Thanks,

I need to get into AppleScripts it seems, they look super handy.

Have you got any good resources for learning just the basics? I was a little overwhelmed by their documentation.

Ah I see now that you can use more than one key in keystroke so yes CMD-N works.

Thank you

I'm not able to post another question today as I'm a newbie so I thought I'd cheekily put it here just in case you knew:

I'd like to be able to grab a section of the output text within Terminal and use it as a variable.

Is this possible with one of the functions (actions) of Keyboard Maestro and if so which one?

It's better if you detail what your end goal is, as there may be a better way to achieve it than grabbing text from Terminal. That said, have you tried running the terminal commands as a Shell script in KM? It will output the result to a variable.

As @noisneil says, if you don't need to interact with the shell (like typing in a password or similar) you'll find it easier to use a KM "Execute Shell Script" action than to get the contents of a Terminal window and then parse out what you need. You can read about the action on the Wiki -- as always, it'll make more sense if you've at least skimmed the manual so you know where to go later to find out about other actions, tokens, variables, and so on.

And do have a read of Tip: How Do I Get The Best Answer in the Shortest Time? so you get the best bang for your limited-questions buck!

2 Likes

Generally it's a better practice to use a Select or Show a Menu Item action instead of emulating a keystroke.

This is not mandatory by any means, and sometimes keystroke emulation can be a trifle faster – but the select-menu action tends to be way more robust.

2 Likes

You're right I should detail the whole plan.

Objective
I'm trying to automate the testing of an application that runs on a decentralised network.

In order to do this I must do the follow:

  1. Initialise two separate nodes in separate terminal windows (to create the test network)
  2. Run a few commands inside each node (this is why I used the "open application" trigger because I want to interact with the running nodes)
  3. Copy some information from within each node to a web browser in order to view the application

I hope that's a little clearer. I have attached a screen shot of the running nodes.

I've highlighted the text I need to copy into the browser.