enigma2k Posted August 1, 2015 Posted August 1, 2015 Hi, I'd like to remap keys using Alfred Workflow. So when I press a specific hotkey (e.g. Shift+left arrow) as trigger that Alfred outputs a different hotkey (e.g. Ctrl+Shift+Tab) as output. Setting the hotkey trigger as input is no problem but I could not find an option in Alfred for a hotkey output. Won't this work as Alfred Workflow?
jdfwarrior Posted August 2, 2015 Posted August 2, 2015 Hi, I'd like to remap keys using Alfred Workflow. So when I press a specific hotkey (e.g. Shift+left arrow) as trigger that Alfred outputs a different hotkey (e.g. Ctrl+Shift+Tab) as output. Setting the hotkey trigger as input is no problem but I could not find an option in Alfred for a hotkey output. Won't this work as Alfred Workflow? Alfred doesn't currently have this but you could use a Run Script item after the hotkey, set the languages to AppleScript and use AppleScript to simulate the hotkey. Would that work?
enigma2k Posted August 2, 2015 Author Posted August 2, 2015 Thanks David! I'd have loved a simple way but I guess I have to use an Applescript. Would this be correct, if I want to use it within Safari? tell application "Safari" keystroke "TAB" using {control down, shift down} end tell In Alfred I've set the Trigger hotkey as "Shift+left arrow" and only be active when Safari is focused.
jdfwarrior Posted August 4, 2015 Posted August 4, 2015 Thanks David! I'd have loved a simple way but I guess I have to use an Applescript. Would this be correct, if I want to use it within Safari? tell application "Safari" keystroke "TAB" using {control down, shift down} end tell In Alfred I've set the Trigger hotkey as "Shift+left arrow" and only be active when Safari is focused. You MAY have to use System Events to send it. I also did it with a menu item instead of the hotkey because.. my iMac is being kinda quirky right now. It also won't let me copy and paste text right now (its having a case of the Mondays). This code works on my laptop though. tell application "Safari" to activate tell application "System Events" tell process "Safari" click menu item "Show Previous Tab" of menu 1 of menu bar item "Window" of menu bar 1 end tell end tell
enigma2k Posted August 4, 2015 Author Posted August 4, 2015 Thank you David, I'll try it out! Do you think we will see in the future a simpler solution, so we can use a hotkey output without having to use a script?
deanishe Posted August 4, 2015 Posted August 4, 2015 You're quite likely to run into problems trying something like this. This issue is that the app receiving the keystrokes can't tell the difference between the modifiers specified in the AppleScript and the ones you're currently holding down to activate the workflow action via Alfred. That is to say, if you set up a hotkey in Alfred, say CMD+SHIFT+A, to send CMD+ALT+S to an application, the application will register CMD+SHIFT+ALT+S because you've probably still got your finger on the SHIFT key. You should make sure that the modifiers you assign in Alfred are the same as, or a subset of the modifiers you want to send to the application.
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