virpio Posted January 28, 2022 Posted January 28, 2022 Hi, I have a workflow with plenty of different actions all evolving around a similar data set. E.g. a lot of workflows start by first having the user select from a list of available data to act up on. Right now I do this by having a Script Filter as a start which then has a bash script to generate this list, and this bash script I copy around over and over. After the user chooses an entry from the list, I then need to run another script to resolve that item to a path or URL to then do something with it. Since this is a lot of copy and paste and it makes it really annoying when you find a bug in the script and have to then fix that same issue in 10 places, I would love to have a bash script that is shared in the workflow that just exposes a couple of functions, so that in the Script Filter action, I could simply say something like getSourceList() and then in the next script phase resolveIdentifier(${1}). Is this possible somehow? I don't seem to find any way to add a shell script to a workflow that is imported at the beginning of every script in the workflow. Thanks for your help!
vitor Posted January 28, 2022 Posted January 28, 2022 Save the bash script to the Workflow’s root directory, then just source script_name before calling your functions. virpio, gohoyer and giovanni 2 1
virpio Posted January 28, 2022 Author Posted January 28, 2022 omg god, thanks! This is SOOO helpful, that should be something you can do via the UI.
vitor Posted January 28, 2022 Posted January 28, 2022 That’s a feature of the language. It wouldn’t make sense to have it as part of the UI because it’s a piece of code like any other.
virpio Posted January 28, 2022 Author Posted January 28, 2022 I'm more talking about the fact that you can actually put a script inside of the workflow folder without Alfred touching that + Alfred invoking the scripts so that they are running from inside that folder. Having even just a button that would open this folder would make it clearer that this is actually something you can do, although what I would love to see is to have these files actually be represented in the grid similar to a script phase.
vitor Posted January 28, 2022 Posted January 28, 2022 6 minutes ago, virpio said: Alfred invoking the scripts so that they are running from inside that folder You may also be interested in External Script as the Language. 7 minutes ago, virpio said: Having even just a button that would open this folder It’s the square to the left of Cancel.
virpio Posted January 28, 2022 Author Posted January 28, 2022 32 minutes ago, vitor said: It’s the square to the left of Cancel. 🤯 I had no idea! Thank you!
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