mescalito Posted January 28, 2016 Share Posted January 28, 2016 How can I create a new workflow that, with the press of a hotkey, would run an "alfred command", meaning something I type in the alfred window. Maybe an "Alfred command" would be a nice action to add. Link to comment
deanishe Posted January 28, 2016 Share Posted January 28, 2016 Why don't you just add a hotkey to the workflow you want to call? Link to comment
Vero Posted January 28, 2016 Share Posted January 28, 2016 How can I create a new workflow that, with the press of a hotkey, would run an "alfred command", meaning something I type in the alfred window. Maybe an "Alfred command" would be a nice action to add. If you share a little bit more about the actual action you'd like to achieve, I'm sure we can help you create a workflow to do what you need. Cheers, Vero Link to comment
mescalito Posted January 28, 2016 Author Share Posted January 28, 2016 Ok, I use EggTimer (http://geekzone.philosophicalzombie.net/post/45984228801/eggtimer2). I also sometimes do the Pomodoro Technique with it doing: Timer 25 Timer 5 Timer 25 Timer 5 And so on. I wanted to create a workflow that would start/stop this automatically. Si I click shift+cmd+p so a sequence of Timer 25/Timer 5 will be executed. Link to comment
deanishe Posted January 28, 2016 Share Posted January 28, 2016 You can do this with AppleScript. Create a workflow and add a Run Script Action with language set to /usr/bin/osascript (AS), and paste the following in the Script box: tell application "Alfred 2" to search "Timer 25" delay 0.2 tell application "System Events" to keystroke return Then add your Hotkey and connect it to the Run Script Action.The first line will open Alfred with the query "Timer 25" and the third line simulates pressing RETURN. AppleScript doesn't wait for Alfred to react to the search command, so you need the delay to give Alfred time to open before you simulate the RETURN keypress (otherwise the keypress will be sent to whichever application is active instead). If you end up with Alfred open and "Timer 25" in the search box, increase delay 0.2 to delay 0.5 or higher. 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