Jump to content

Option to run Script Filter with final query


vitor

Recommended Posts

The way Alfred processes Script Filters is to rerun them on every keystroke, and on ↵ use whatever arg: is at that time. While this is fast and the best option for most situations, in others it can mean that we don’t get the desired result when typing too fast.


A common pattern in my personal Worflows is to set a Script Filter that shows me information, but what I want to pass downstream is argv (e.g. the Script Filter shows options that I can autocomplete, but the final content can be anything). The way to do that is to set arg: in the JSON to argv. I can even go so far as saying “if argv is nil, use this default info, otherwise use argv”. The trouble is that if I type my query and press ↵ before the Script Filter has finished running for the last keystroke, what will be passed down is incomplete information—whatever the last run had.


So I’d like to have the option (Run Behaviour seems like a good screen to stick it, maybe in Queue Mode) to “Always run last script” or “Action with contents of full query” or something to that effect—a way to know that even if press ↵ before Alfred reruns the Script Filter, it will still do it before passing information downstream.

 

Alternatively, if there’s a worry of bug reports from people who turned the option on without understanding it and think they are getting wrong results, the option to not allow ↵ (i.e. Alfred stays open without actioning) until the last query runs would be the second best option.

Link to comment
Share on other sites

4 hours ago, deanishe said:

Do you mean "Don't respond to my ↩ keypress until the Script Filter has finished executing with the query in Alfred's input field at the time I pressed ↩"?

 

That’s the second best option (last paragraph). My first option would be to have Alfred be dismissed anyway and run what would have been the result of the last script execution. But I understand that may pose some issues, so I’ll take what I can get as long as it assures incomplete queries can be prevented without having to purposefully wait.

Link to comment
Share on other sites

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