Jump to content

How can I append text to a TERMINAL COMMAND?


Recommended Posts

Hi,

 

first of all, sorry for my english.

 

The other day I found that there is a terminal command to force openning an app more than 1 time. For example, openning two VLC windows.

 

That terminal command is 'open -n /applications/vlc.app'

My idea is to create a ALFRED WORKFLOW similar to this:

 

zdvd.png
 

openn USER_INPUT_(APP_NAME)

 

an example:

 

typing openn vlc

 

then, execute the terminal command:  open -n /applicaciones/USER_INPUT_(APP_NAME).app

 

I know how to get USER_INPUT_(APP_NAME), but I do not know how to "paste" this text in the TERMINAL COMMAND

 

 

One more thing, is there any command to really close a TERMINAL WINDOW?  I know there is 'exit' but this command does not close the windows, just finish the console.

 

Again sorry for my english, and thank in advance.

 

 

 

Link to comment

I know how to get USER_INPUT_(APP_NAME), but I do not know how to "paste" this text in the TERMINAL COMMAND

Simply double click the Terminal Command node, and paste your text (it should be open -n "/applicaciones/{query}.app" — don’t forget the double quotes, as they’ll be useful for applications with more than one word in the name).

 

One more thing, is there any command to really close a TERMINAL WINDOW? I know there is 'exit' but this command does not close the windows, just finish the console.

Yes and no. exit is the command to leave the shell, but once that happens, the terminal has a say. On apple’s Terminal.app, you need to go to Preferences… → Settings → When the shell exits, and pick another option. This won’t close the Terminal, though, just the window. If you want the terminal to close, you can try something like iTerm2. You can also quit the terminal via applescript with (this code works if you’re running it from bash)

osascript -e 'tell application "Terminal" to quit'
but that isn’t that fun, and can lead to some undesired results. What you should do in this case, is forget about Terminal Command altogether, and use the Run Script node (everything else you’ll do the same, you just change this), and you won’t even need a terminal. Edited by Vítor
Link to comment

Hi,

 

first of all, sorry for my english.

 

The other day I found that there is a terminal command to force openning an app more than 1 time. For example, openning two VLC windows.

 

That terminal command is 'open -n /applications/vlc.app'

My idea is to create a ALFRED WORKFLOW similar to this:

 

zdvd.png

 

openn USER_INPUT_(APP_NAME)

 

an example:

 

typing openn vlc

 

then, execute the terminal command:  open -n /applicaciones/USER_INPUT_(APP_NAME).app

 

I know how to get USER_INPUT_(APP_NAME), but I do not know how to "paste" this text in the TERMINAL COMMAND

 

 

One more thing, is there any command to really close a TERMINAL WINDOW?  I know there is 'exit' but this command does not close the windows, just finish the console.

 

Again sorry for my english, and thank in advance.

 

I think you want something like this. It's a file filter that will find apps only, attached to a Run Script object that will open a new instance of the app you choose.

 

Note: the file filter will search more locations than just /Applications/

Link to comment

I think you want something like this. It's a file filter that will find apps only, attached to a Run Script object that will open a new instance of the app you choose.

 

Note: the file filter will search more locations than just /Applications/

 

that's exactly what I was looking for.

 

Besides, it has help me to understand better how this workflows works

 

Thanks!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...