Jump to content

Have a bash script with functions available in workflow


Recommended Posts

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!

Link to comment

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.

Link to comment
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.

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