xanimus Posted August 14, 2022 Posted August 14, 2022 (edited) Following situation: I have written a bash script to provide me a list of text suggestions Each text has an abbreviation When typing the abbreviation, I want the script filter to suggest the full text (basically setting the suggestion's autocomplete to "${query}${suggestion}") This way, I can build a sentence quickly, from multiple text suggestions My problem is, that when I type text for which there is no suggestion, and I press enter, the workflow step sends an empty string to the next step because it thinks my selection is empty. How can I make the script filter use the entire input field content as output, if no suggestion was selected? I have multiple problems I know I can make the text itself into a suggestion, but that is slow (the script has to run each time) I have to run the script each time anyway, since I need to set "${query}${suggestion}" as autocomplete, or otherwise it will replace the entire content of the input field Can I make the script filter pass the entire input field value, if no selection matches or my typing is too fast for the script to finish? I would even prefer a solution with "Alfred filters results" Thanks! Edited August 14, 2022 by xanimus
vitor Posted August 16, 2022 Posted August 16, 2022 Welcome @xanimus, This is sounding like an XY problem. Can you give real example uses of the Workflow? Why not instead use Snippets or a List Filter Input connected to a Copy to Clipboard Output? Maybe what you want is to use a Keyword Input with the same keyword as your Script Filter, so that when the latter doesn’t have results, you’ll act on the former. Or setup a Fallback Search Triggers. See a previous post for more information (replace File Filter with Script Filter).
xanimus Posted August 22, 2022 Author Posted August 22, 2022 (edited) I worked around it by having two hotkeys. One that takes random input, and one for the script filter with 'Alfred filters results'. Is there a way I can set one item to always match (i.e. match any query) and always use the query as title/arg (all this when using 'Alfred filters results')? Edited August 22, 2022 by xanimus
vitor Posted August 22, 2022 Posted August 22, 2022 Alfred filters results is simple and concerned with speed. That kind of custom behaviour has to be handled in your code.
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