Jump to content

Send multiple input vars to script?


Recommended Posts

I want to build a workflow that uses a File Action (get a file path) and a Keyword (ask for a tag/string). I want to pass both values to a script.

What I've tried is using vars to store both values as {var:path} and {var:tag}, but those vars are not available in the script. Also, using $1 and $2 was not successful.

 

Any ideas on how I can pass multiple input args to my shell script?

 

image.thumb.png.4b3b91d16e74bf8babd90fe40844c055.png

Link to comment
19 hours ago, Philipp Str said:

What I've tried is using vars to store both values as {var:path} and {var:tag}, but those vars are not available in the script.


They are, but you have to access them as the language expects. In this case as ${tag} and ${path} (see link posted by @Stephen_C). But don’t use path at all to avoid conflicts.

 

By splitting arguments (refer to @Stephen_C’s other link) you can either have them as variables or as separate arguments, for ${1} and so forth.

 

I still encourage you to finish the workflow for the learning experience, but what you want can be accomplished in Alfred without any code: See Label Colour Tag, which will also help with your specific questions.

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