Jump to content

Dynamically choosing whether to close Alfred


Recommended Posts

I like the new "Don't close the Alfred window on actioning the result" option; less flicker is good. However, I'm finding there are times where I'd like that option to be dependent on the output of a Script Filter. For some outputs, I'd like to keep the window open, but for others, close it. I've tried filtering branches, similar to this post, but that doesn't seem to help. Here's the overall structure I'm currently trying out:

 

Screen%20Shot%202016-06-23%20at%208.26.3

 

I've verified that the filters are working as expected (only one branch is ever taken at a time). However, no matter which branch is taken, Alfred stays open after I action an item.

 

Should this work? Is there another way to force the Alfred window to close, possibly via AppleScript?

Link to comment

Should this work?

 

 

Alfred has no forward knowledge in your workflow, so if there is one output which necessitates a "Keep Alfred Open", then he defaults to this.

 

There may be a case for a workflow "Hide Alfred" utility object, I'll make a note to look into this :)

 

Cheers,

Andrew

Link to comment

Alfred has no forward knowledge in your workflow, so if there is one output which necessitates a "Keep Alfred Open", then he defaults to this.

 

There may be a case for a workflow "Hide Alfred" utility object, I'll make a note to look into this :)

 

Cheers,

Andrew

 

 

I had a feeling that wouldn't work, but the other posting seemed to suggest it would. I was guessing Alfred might close itself when it saw that the keep-it-open branch was a dead end.

 

A "Hide Alfred" utility would be nice.

 

@deanishe mentioned somewhere that Alfred will attempt to parse the output of a script to see if it's an alfredworkflow JSON object. That would potentially be a good point for the script modify Alfred's behavior dynamically, such as telling it whether to stay open or close.

Link to comment

One issue I just ran into for this is that holding down a modifier causes Alfred to close even when the default connector says to stay open, at which point sending an Escape key will send an escape to whatever window ends up with focus.

Edited by jason0x43
Link to comment
  • 11 months later...
On 6/24/2016 at 2:33 AM, jason0x43 said:

One issue I just ran into for this is that holding down a modifier causes Alfred to close even when the default connector says to stay open, at which point sending an Escape key will send an escape to whatever window ends up with focus.

I'm having the same question actually. The only way I've found is to repeat the same sequence of objects. Any way to force the not closing of Alfred programmatically? Or to make it not close for any modifier (even actually if no modifier is used)?

Alfred_Preferences.png

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