Jump to content

Can Alfred Filter Items on a Script Filter Workflow?


Recommended Posts

I have a workflow that loads all the items in a folder by feeding them back to Alfred via a Script Filter and everything works fine. Is there a way to set it so that if I type an argument after the results are loaded that Alfred shows only the results that match the argument I type? Basically the way most file searches begin filtering results if you continue typing more components of the file name.

Link to comment

In a script filter this can absolutely be done. Look into post I made about reusing script filters and chaining them together. Basically shows you different ways to add delimiters for different data in your input or whatever. You could have it show all results with no input and then filter or show all based on first input then use a delimiter to indicate you want to filter based on that

Link to comment

Thanks, David. I looked at those samples but I don't think that's quite what I'm trying to achieve. I was hoping to avoid having to hit the enter key. Is there anyway for Aflred to re-fire the script as I type similar to the way that, for example, if I'm searching files it resets the results as I type?

Link to comment

Thanks, David. I looked at those samples but I don't think that's quite what I'm trying to achieve. I was hoping to avoid having to hit the enter key. Is there anyway for Aflred to re-fire the script as I type similar to the way that, for example, if I'm searching files it resets the results as I type?

 

You wouldn't have to hit enter using the setup I mentioned in the previous message with delimiters.  

For instance, if you had a workflow that you type the keyword "files" and then some input "myFolder" to show all the files in "myFolder", you could them use a ":" or some other delimiter to signify that you were entering a second term and wanted to filter based off that.. So you input could be something like.. "files myFolder:sample". You script filter would parse the input and know that anything after the : would be something that you were filtering off of. Or, are you meaning that you wanted to use Alfred's built-in filters? I took it to mean that, since you were using a script filter, that you would filter the results

Link to comment

This workflow is a perfect example of what I'm trying to do - http://www.alfredforum.com/topic/2319-cyberduck-favorites-open-a-connection-with-cyberduck-favorites/

 

When you type "connect" you get all Cyberduck's bookmarks. If you keep typing, it filters the results down based on what you're typing. I feel like I'm missing something obvious, but I cannot find out how to add this dynamic feature of changing the results list as you type.

Link to comment

This workflow is a perfect example of what I'm trying to do - http://www.alfredforum.com/topic/2319-cyberduck-favorites-open-a-connection-with-cyberduck-favorites/

 

When you type "connect" you get all Cyberduck's bookmarks. If you keep typing, it filters the results down based on what you're typing. I feel like I'm missing something obvious, but I cannot find out how to add this dynamic feature of changing the results list as you type.

In this case it sounds like it's just a regular script filter with an optional parameter where, when the filter runs, you would check the input and see what's there. If it's blank, get the entire list and show results. If the user has provided some input, grab all items, filter them, only show matched results

Link to comment

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