Jump to content
vitor

Option to run Script Filter with final query

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.

Share this post


Link to post
Share on other sites

I'm not sure what you're requesting here. 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 ↩"?

Share this post


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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...