Philipp Str Posted January 14 Share Posted January 14 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? Link to comment
Stephen_C Posted January 14 Share Posted January 14 Welcome to the forum. Use the Split Arg utility and then process the arguments in your shell script (for that, see the Alfred help page on Reading Environment Variables). Stephen vitor 1 Link to comment
vitor Posted January 14 Share Posted January 14 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
Philipp Str Posted January 14 Author Share Posted January 14 Thanks for the hints! I got the workflow to behave as expected by Using "tag_path" instead of "path" as mentioned by @vitor, and Using the Split Arg utility [split by tabs] Thanks for the great help 👍 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now