maillardduck Posted February 12, 2016 Share Posted February 12, 2016 (edited) Can anyone suggest a way or sketch a workflow to be able to run shell scripts from alfred directly? Example: Say I have a example.sh in /home/folder/ I'd like to be able to run this from Alfred; i.e. the following sequence of events happen: 1. I type example. 2. example.sh shows up in the list of results. 3. I [hotkey] to the options menu of example. 4. I [hotkey] something (a workflow?) to execute the script (in /home/folder). Edited February 12, 2016 by maillardduck Link to comment
deanishe Posted February 12, 2016 Share Posted February 12, 2016 To find your scripts, your best bet is probably to set up a File Filter. Then to run it, you can use (something like) the following script in a Run Script action: script_path="{query}" script_dir=$(dirname "${script_path}") cd "${script_dir}" "${script_path}" Note: This script requires the executable bit to be set on the script you're trying to run. You can connect your File Filter directly to the Run Script action and/or use a File Action. 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