Jump to content

With a Script Filter, when selecting an option, replace the current keyword with a new one


Recommended Posts

Posted (edited)

I'd like to create a Script Filter, where when the user selects an option, then the current Alfred keyword is replaced with a new one.

 

So for instance, the user types in "test " (with a space at the end), and then the script shows the options dropdown, and the user picks one and hits Enter, then the keyword now shows "test one", and my script will then show a new set of options.

 

How can I do this with Alfred? Is it possible to do by connecting one Script Filter to another?

 

Thanks!

Edited by Gary King
Posted (edited)

(Assuming your keyword is test.) Set valid to false on your item and autocomplete to one. That way, when the user hits ↩ or ⇥, the query passed to your script will now be one.

Edited by deanishe
Posted

Ah excellent thanks. It isn't clear at first that this is the way to go, since I rarely use those fields in the JSON output, but they are indeed very useful here.

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