Jump to content

Trigger when Alfred bar is active / inactive


xan

Recommended Posts

2 hours ago, xan said:

I have a specific set of workflows where I'd love to utilize a trigger for when Alfred's search bar is activated and deactivated.

How would you expect them not to run if you wish to activate Alfred for other purposes (e.g., a standard search or to run some different workflow)?

 

Stephen

Link to comment
Share on other sites

51 minutes ago, Stephen_C said:

How would you expect them not to run if you wish to activate Alfred for other purposes (e.g., a standard search or to run some different workflow)?

I would expect those workflows to always run and then proceed with the current flow. Additional filters like "Related Apps" in hotkey could also apply to the trigger.

 

The use case in my mind would be to control other apps that act as an input proxy like Karabiner to know whether the Alfred bar is active or not. Currently, I'm using a hack on top of a hack to properly manage my Karabiner profiles (I want a different profile when Alfred is active).

 

I imagine there could be other use cases for such triggers (Alfred bar activated, Alfred bar deactivated).

 

xan

Link to comment
Share on other sites

6 hours ago, xan said:

The use case in my mind would be to control other apps that act as an input proxy like Karabiner to know whether the Alfred bar is active or not. Currently, I'm using a hack on top of a hack


But your use case for this feature is also a hack, and one with a single use case but many problematic consequences. Here’s one example: you’re building a workflow, and while testing mistakenly set it up so that every time Alfred is opened, it runs the system command to turn off your Mac. Now you’re stuck and can’t disable the problem.

 

Instead, I recommend you set a custom shortcut to show Alfred and go from there. You can also show Alfred via AppleScript (tell application id "com.runningwithcrayons.Alfred" to search) so perhaps you can make a shortcut to both do that and activate whatever else you need.

Link to comment
Share on other sites

14 hours ago, vitor said:

Instead, I recommend you set a custom shortcut to show Alfred and go from there. You can also show Alfred via AppleScript (tell application id "com.runningwithcrayons.Alfred" to search) so perhaps you can make a shortcut to both do that and activate whatever else you need.

That is very useful, thank you. However, this solves one part of my problem - knowing when Alfred activates. Is there also a way to know when it deactivates?

Link to comment
Share on other sites

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