Floating.Point Posted December 9, 2021 Posted December 9, 2021 Summary: Requesting context sensitive Keywords - just like the Hotkey's related apps --- More and more I am using Alfred to automate activities within the apps I use daily. Running scripts, loading workspaces, modal menus, macros etc - all context sensitive to the foreground application. While I love putting Alfred to use in this way, my implementation lacks one of Alfred's features I find most valuable… the keyword. I wish there was a way to have something like the 'related apps' function from the hotkey input available for keywords. This would allow the same keyword to do different things depending on the foreground app. For example executing the keyword 'align' would do one thing if Photoshop is foreground, and something completely different if Cinema 4D is foreground. What I love about Alfred is I don't have to remember myriad different keyboard shortcuts to automate my workflows, so if it were possible to have context sensitive keywords, the whole system would become a little more flexible
vitor Posted December 11, 2021 Posted December 11, 2021 Making Keywords context sensitive is trickier than for Hotkeys. Invoking Alfred and typing only not to see some results could be confusing and lead to unnecessary bug reports. Prioritising Keywords depending on context might be best, but may not fit with Alfred’s learning. Right now, there’s two ways to achieve what you want: The first is to have multiple Keywords with the same text. At the time, you chose the relevant one (a good icon will help there). The other requires a couple of objects:Make a Keyword Input.Connect it to a Run Script Action with Language set to /bin/bash and Script set to osascript -e 'tell application "System Events" to return name of first process whose frontmost is true' | tr -d '\n'. This will return the name of the frontmost app.Connect that to a Conditional Utility and set is equal to to the names of the apps you want to affect.Then connect those to the appropriate actions. If your Keyword takes input, you may have to add an Argument and Variables Utility in there to save it. deanishe and Floating.Point 1 1
Floating.Point Posted December 11, 2021 Author Posted December 11, 2021 Vitor, thank you. I didn’t imagine I’d be up and running with this functionality immediately. I completely understand the potential for confusion with this approach and why it might not make sense to support it directly. Luckily for me, you exist and have provided a great solution. Again thank you 🙏 vitor 1
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