jason0x43 Posted June 23, 2016 Share Posted June 23, 2016 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: 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
deanishe Posted June 23, 2016 Share Posted June 23, 2016 Simulating an ESC keypress in AppleScript should do the trick: tell application "System Events" to key code 53 Link to comment
Andrew Posted June 23, 2016 Share Posted June 23, 2016 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
jason0x43 Posted June 23, 2016 Author Share Posted June 23, 2016 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
jason0x43 Posted June 23, 2016 Author Share Posted June 23, 2016 (edited) 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 June 23, 2016 by jason0x43 Link to comment
jason0x43 Posted June 23, 2016 Author Share Posted June 23, 2016 Ah, but I suppose I can deal with that by letting the downstream object know that it was accessed with a modifier. Link to comment
godbout Posted June 1, 2017 Share Posted June 1, 2017 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)? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now