Jump to content
amahabal

Script Filter: Mixing fixed and smart ordering?

Recommended Posts

For a Script Filter, I want to use Alfred's smart ordering, which one can produce by passing in uid's to items. However, I want to exclude precisely one item from this, which I always want to be the top result. Is there any way to get the best of both worlds? 

 

Incidentally (and maybe this should be a separate question), in my system, this fixed item is always (intentionally) invalid: it is additional information that just hangs in there. Is there any way to make the default selection (what gets actioned if we press return) start at the first valid entry? 

 

Thanks!

  Abhijit

Share this post


Link to post

This doesn't answer your question directly, but one approach which i've used is to set the subtitle of items to display additional info. Another trick I've used is to create multiple items with the same keyword.  I use both in this example:

 

 

Screen Shot 2020-06-29 at 8.48.16 PM.png

Share this post


Link to post

Thanks for the response, @dfay. I do use subtitles for information about the items. What this top item is doing is information about the entire list of responses.

 

What I am doing is this: I  have set up a system, backed up by a local database, where I can set up sets of contexts (people, projects, etc), and for which I can capture URLs, file links, and other bookmarkable paraphernalia. Now, for a given hub, all these possibilities are shown, plus other possibilities such as "Create an omnifocus project for this" (shown only if none exists), "Create a Devonthink group", etc. All the heavy lifting is done by python scripts, and Alfred's role is showing the responses and shuffling state around, and enabling the possibility of filtering down shown responses based on what I type in the box. The box real estate is thus at a premium, and I don't have space to show what item the responses are for (the python script gets it through variables, not through argv).

 

What I need, then, is a way to show a response at the top announcing "This is me!". Currently, I do have that, but it can be anywhere. A distinct icon helps me see it if it is in the top 9, but a little additional UI assistance from Alfred will help.

 

Hope that explains the strange request :)

Share this post


Link to post
Posted (edited)

Does the "This is me!" item need to respond to the script filter or is it going to be fixed regardless of the search?  If not you could create a new trigger with a name which is a subset of or the same as your existing keyword.  Then if you trigger it a couple times it should always appear before the filter.

Screen Shot 2020-06-30 at 5.59.00 PM.png

Edited by dfay

Share this post


Link to post

 

It depends on the query (which  is coming in through vars). Here, I show some results when the query context is "Alfred". The distinct logo tells me that this is the context. When the context is a URL, it can be very long and I can't stuff it into the query box and still have space for additional words that filter down the result set.

 

 

730539045_ScreenShot2020-06-30at8_58_00PM.thumb.png.7eb17c257d872ad62f440c52d8106fe1.png

Share this post


Link to post
On 6/30/2020 at 12:52 AM, amahabal said:

Is there any way to get the best of both worlds? 

 

You can't set UIDs and impose ordering at the same time. What might work for you is only setting UIDs if there's a search query. That way, you can have your informational item at the top (and other items in a predictable order), but still train Alfred to associate specific items with specific queries.

 

On 6/30/2020 at 12:52 AM, amahabal said:

Is there any way to make the default selection (what gets actioned if we press return) start at the first valid entry?

 

No, but if you do the above, your default results should be in a predictable order, and you can also omit the invalid/informational items when there's a query.

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