Jump to content
f1nnix

How to control empty command results?

Recommended Posts

Posted (edited)

I'd like to implement the following workflow:

 

  1. When I hit Option + Space, I'd like to see a list of TODO-tasks from Things 3.
  2. If I start typing something, todo list is immediately replaced with relevant search results.
  3. If I delete all written text, the default results with todo tasks are shown again.
  4. Todo tasks can be selected with up and down arrows and chosen with Enter as ordinary lists.

 

There's no problem to access Things 3 (or any other collection database), but bow to inject items on empty screen? In other words, is there any way to control results for empty command?

Of course due to desired workflow, I realise that I won't be able to filter TODOs as typing any symbol will immediately fall into ordinary search routine, but it's OK: arrows selecting should be enough.

 

Thank you.

 

Screenshot 2020-07-11 at 21.52.53.png

Edited by f1nnix

Share this post


Link to post
7 minutes ago, f1nnix said:

In other words, how is there way to control results for empty command?

 

I don't think that's possible. You can create a workflow that shows your Things todos when you hit OPT+SPACE, but you can't have it filter Alfred's default results, at least not without re-implementing all that yourself, and you can't change what Alfred's "home screen" shows.

Share this post


Link to post
Posted (edited)
14 hours ago, deanishe said:

and you can't change what Alfred's "home screen" shows.

 

Ah, thank you, that's sad a bit. So no way to list some handy info near at hand with Alfred? May be some default search tricks?

 

I'm new to Alfred WF dev, so I may be not aware of some obvious tricks, which can fit my workflow.

Edited by f1nnix

Share this post


Link to post
Posted (edited)
8 minutes ago, f1nnix said:

So no way to list some handy info near at hand with Alfred?

 

Sure. You can assign a Hotkey to bring your own workflow straight up, which can show whatever you want, with or without a query. And you can use ⌘⌫ to back out of that to Alfred's default search.

 

But Alfred's default search will not show anything without a query, and you can't change that. And you can't insert results from a workflow into Alfred's default results, either.

Edited by deanishe

Share this post


Link to post

If you wire a hotkey directly into a script filter (set to Argument Optional), you essentially have your own version of Alfred's interface where your script controls everything that Alfred shows. You even get your own icon to the right of the window.

Share this post


Link to post

Yeah, thank you. But that's not exactly the problem I'm solving. I want not to make my own Alfred instance, but to integrate into existing one :).

 

You see, using TODO apps or similar ones have one significant flaw: you have to remember to open app and check TODO list. It doesn't matter, how exactly: open separate app or launch special command or hotkey with Alfred. If you don't consciously  do it, even best TODO-app will not work for you. Even macOS sidebar with widgets needs to be launched manually, which makes it completely useless.

 

I thought it will be great to use Alfred free space on «home screen» to display background info in unobtrusive way, as Alfred/Spotlight — is the only program, which is visible and constantly launched every 15-30 minutes in a normal workflow.

 

Any way, thanks every for help! Right now, I've made `th`-shortcut, which +- fits my needs.

Share this post


Link to post

As I say, you can fake that. If you assign your workflow a Hotkey and always open Alfred that way, you'll always have your list of todos.

 

And you can set up your Script Filter so that as soon as you start entering a query, it calls Alfred’s default search with that query (tell application id "com.runningwithcrayons.Alfred" to search "<your query>").

 

That sounds like it'll give you exactly what you're trying to achieve, just not in the way you wanted to do it.

Share this post


Link to post
Posted (edited)

What you might also do is add an Arg & Vars element after your Hotkey to set, say, homescreen=true. Then your Script Filter can redirect the query to Alfred’s default search if the variable is set, and filter your todo list like a regular Script Filter if it isn’t (because you called the Script Filter via its keyword).

Edited by deanishe

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