Jump to content
matthew16

How to include workflow results in default search

Recommended Posts

 

 

 

 

*************** Please see new thread ******************

 

 

 

 

 

 

I'd like to see the results of some my workflows in the default search. In particular, I am regularly searching for my pinboard bookmarks with https://www.alfredforum.com/topic/4435-pinboard-15-for-alfred-3-search-add-and-delete-bookmarks/. How can I see the results of this script filter mixed in with my default search?

Edited by matthew16
add link to new thread

Share this post


Link to post

You can’t, and that’s a feature, not a limitation.

 

If workflows could plug to your default searches, every query you’d do would be bogged down considerably.

Share this post


Link to post

I appreciate the response, but it is a limitation. 

 

Of course it may slow down the query. That should be something the user is responsible for managing. 

 

Advantages of script filters showing up in the default search:

 

  1. significantly more flexibility and power of workflows
  2. Complete control over what shows up in the default search
  3. Ability to include all searches. For example in my case, Pinboard Bookmarks. This is very important for me.
  4. Ability to customize default results by replacing them workflows.

It is not a hindrance to the user:

  1. 100% optional.
  2. Imported workflows that want to be included in the default search can be dealt with in a variety of ways, such as:
    1. A warning alert that 'This workflow wants to be included in the default search. This could slow down every query, but can be turned off later. Proceed?' And it can have three options: 'Cancel', 'Import without including in default search', and 'OK'.
    2. In the 'Features' pane, there can be a new list of workflows that are included in the default search. Each will have a checkbox. At the top, there can be an off switch for disabling all of them at once.
  3. I believe this will in many cases not slow down the system at all. Has the team tested this? I find it hard to believe my computer can't handle this considering how much it does already.
  4. The user already has to manage performance anyway.

 

It would be beneficial to Alfred and the community:

 

  1. We would probably see an increase in participation and contributions.
  2. Alfred can take ideas from these contributions to further improve the product.
  3. It would be a Powerpack feature, giving user more incentives to buy. $$$

I don't think it would be difficult to implement:

  1. As far as I understand this is just a simple restriction and would not involve any large changes.
  2. The only problem that would need to be solved is deciding how to order the results. I'll throw out some ideas, but I'm sure this calls for further discussion:
    1. Integrate them into the same algorithm based on past actions.
    2. Put them at the bottom or top of the results, with a border distinguishing them from the default results.
    3. In the workflow give options for how the results should be sorted relative to the default results.

 

In conclusion, this would not affect the average user, would give 'Powerpack' users much more 'power', and is a positive step forward for both Alfred and the community.

Edited by matthew16

Share this post


Link to post

The problem with performance isn’t with the machine, but with the network requests. Many Script Filters make requests that take a good while to complete, and that has nothing to do with your machine.


You’re making a lot of unsubstantiated assumptions, especially regarding community benefits — those are immensely inflated. You’re also speculating about how straightforward this would be for users to control. Spend time on these forums and you’ll see many Alfred users would not understand the message and would think the slowness to be an Alfred bug.


Having said all that, there’s no point for us two to keep discussing this. I also do not have the necessary data to give a definitive answer. The answer to your question is clear: you can’t do it currently. With that in mind, you should now open a feature request.

Share this post


Link to post

I also have reservations about including filter results in default queries but it is an interesting idea. Even if results were cached, given the number of workflows some have, results could be in the thousands, tens of thousands, hundreds, or millions. But perhaps if there was some cache time, and if only previously actioned items (with return) were included, that might be interesting.

Share this post


Link to post

@vitor pretty much sums up the reasoning behind this. Essentially, Alfred is extremely lightweight on a user's Mac, having minimal CPU and battery impact at all times. This is essentially achieved by only running the internal logic paths required which lead to the user's desired result at any one time, not running any unnecessary code. This becomes more significant when [non-native] workflows may take a decent amount of CPU or network traffic.

 

Added to the fact that this is a rarely requested feature, it's unlikely that this will be implemented into Alfred's default results.

 

Having said that, and having a think about this, there is one aspect I would consider. You can already create a workflow and attach it to an input filter (such as a file filter, script filter etc). At this point, it's a 1 to 1 mapping for hotkey to input filter. If there was interest, I'd look at enhancing this so that one hotkey could connect to multiple input filters, and results from all filters would be shown. This would essentially allow you to build a workflow which shows a custom version of Alfred with the specific, highly customised results you'd like.

 

Cheers,

Andrew

Share this post


Link to post

There's a potentially large usability issue here, too.

 

Alfred updates the results list live as the various parallel searches (apps, contacts, other defaults) finish. Most of the built-ins complete in a few hundredths of a second, so you don't have to wait long‚ if at all, for the results to "settle down".

 

Workflows, on the other hand, may take anything from a few hundredths of a second (some compiled workflows) to tenths of a second (scripting languages) to multiple seconds (workflows that talk to applications or web servers).

 

If you're not careful about mixing these together, you're going to find yourself either actioning the wrong result quite often or waiting a lot for all the searches to complete.

 

Share this post


Link to post

Aside of all the performance etc., the Problem that i would see here is the overview. Even now i sometimes have issues to find the right file.

Like some have first of all long filenames and/or have similar names. Having a couple of things popping up in your default search would make 

it more like a pain than a gain of features. Like you're not focused at what you wanna see.

Share this post


Link to post
11 minutes ago, FroZen_X said:

Having a couple of things popping up in your default search would make 

it more like a pain than a gain of features.

 

While it's true that more is often less in terms of Alfred's default results, I think Alfred's defaults would benefit from something similar to the email or terminal plugins, so I could add, say, Chrome or Pinboard bookmarks to the default results, instead of Safari's.

 

Currently, to get your Chrome or Pinboard bookmarks into Alfred's default results, you need to export them to the filesystem as .webloc files or similar. That's not exactly straightforward to do, and while Alfred can still say "I'm doing nothing in the background!", you probably now have a far less efficient update mechanism at work.

 

I'm leery of allowing users to plug Script Filters directly into the default results because, as stated above, only compiled programs can come even close to providing results fast enough to not ruin the user experience.

 

But I think it would work well combined with an Alfred-Workflow–like cache model: Only show data from the cache, and trigger a cache update in the background if the data have expired.

 

From my own experiences since Script Filters got the awesome rerun feature, this works very well in terms of UX. The user might have to wait a second or two if they're after new data, but otherwise the item is right there immediately, and the results list rarely changes dramatically when the update finishes.

Share this post


Link to post
54 minutes ago, deanishe said:

I think Alfred's defaults would benefit from something similar to the email or terminal plugins, so I could add, say, Chrome or Pinboard bookmarks to the default results, instead of Safari's.

 

I would think of something that Andrew talked about here:

8 hours ago, Andrew said:

at enhancing this so that one hotkey could connect to multiple input filters, and results from all filters would be shown.

 

Then you could have 2 ways of launching Alfred and even more. Like combining several Filefilters, google/yahoo/bing search, bookmarks in Safari and chrome etc.

 

54 minutes ago, deanishe said:

I'm leery of allowing users to plug Script Filters directly into the default results because, as stated above, only compiled programs can come even close to providing result

 

I definitely agree on that. Like you said, others would see this as a bug.

 

Btw i use this workflow for Chrome bookmarks:

https://github.com/blainesch/alfred-chrome-bookmarks

Edited by FroZen_X

Share this post


Link to post
16 minutes ago, FroZen_X said:

Here is would think of something that Andrew talked about here

 

Connecting a Hotkey to multiple inputs isn't a bad idea, but it would make more sense, imo, to implement multiple inputs at a lower level, ideally allowing workflows to fetch results (or better yet, arbitrary data) from other workflows.

 

At the very least, combined inputs should work with a keyword, too.

 

Share this post


Link to post

Now that I think on it, Alfred doesn't actually give you any way to pass around its most important (from a workflow's point of view) data structure — the item.

 

That's unusual, to say the least.

 

Share this post


Link to post

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