Jump to content

Script output to Terminal Command


Recommended Posts

Is there any way to pass a script action's output to a Terminal Command action?

 

I'm basically trying to set a default argument if no argument is set (the keyword's argument is optional) using a script action, and then pass that to a terminal command, but I find I can't "connect" the output of the script to the input of the terminal command action.  Am I missing something?

Link to comment

Is there any way to pass a script action's output to a Terminal Command action?

 

I'm basically trying to set a default argument if no argument is set (the keyword's argument is optional) using a script action, and then pass that to a terminal command, but I find I can't "connect" the output of the script to the input of the terminal command action.  Am I missing something?

 

Tonio,

 

A run script action is essentially the same thing as a terminal command (as long as you have the language on it set correctly (/bin/bash). So, for your example, could simply do...

userinput="{query}"

if [ -z $userinput ]; then
  userinput="default value";
fi

// rest of your code here

 

That would take what the user enters (or nothing) and set that value to the variable userinput. It then checks to see if that value is empty and if so, assigns a default value to it, then would proceed on to do anything else you wanted.

 

Hope this help. Let me know if you have any other questions

Link to comment

Tonio,

 

A run script action is essentially the same thing as a terminal command (as long as you have the language on it set correctly (/bin/bash). So, for your example, could simply do...

userinput="{query}"

if [ -z $userinput ]; then
  userinput="default value";
fi

// rest of your code here

 

That would take what the user enters (or nothing) and set that value to the variable userinput. It then checks to see if that value is empty and if so, assigns a default value to it, then would proceed on to do anything else you wanted.

 

Hope this help. Let me know if you have any other questions

 

Yeah, that was my first thought... but the command I'm running has a lot of output and takes some time to run, which is why I opted for the terminal command action (so the user would see the output as it's being generated).

 

Notification and Large Script clearly won't cut if as output targets, since the output's too long.  I guess I could pipe it to a Run Script output which opens up a tcl/tk window, or something like that, with the output... but since Terminal Command fit the bill so well, I'm hesistant to try to hack my way around it. =/

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...