sepulchra Posted November 25, 2021 Share Posted November 25, 2021 Hey all, I just started using brett terpstra’s awesome Doing command line tool. And it looks like there was and alfred 2 workflow that was created with a previous iteration, but I can’t get it to work. I don’t know if anyone else is using “doing” but I could use some help. I’m looking to build a workflow that can pass some of the commands like “doing now” and doing later” directly from alfred. When I run the workflow i get this error: I really don't have much experience with scripting beyond lots of trial and error and searching about. Thanks! Link to comment
deanishe Posted November 25, 2021 Share Posted November 25, 2021 (edited) The workflow is poorly written (sourcing dotfiles like that is almost always the wrong thing to do). Replace the contents of the central Run Script element with the code below. Then it should work. I've commented out the two lines I changed. # source ~/.bash_profile export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH if [ "{query}" == ? ]; then osascript -e ' set _doing to do shell script "doing recent" -- tell application "Alfred 2" to search _doing tell application id "com.runningwithcrayons.Alfred" to search _doing tell application "System Events" keystroke "l" using {command down, option down} end tell ' else doing now "{query}" echo "Added new task" fi Edited November 25, 2021 by deanishe Link to comment
sepulchra Posted November 25, 2021 Author Share Posted November 25, 2021 Forgive me as I am learning here, but I'm guessing there might be a better way to do this. I realize I didn't need the "doing recent" command. I just need the commands that add to the "doing now" section and the "doing later" section. I've built a workflow like this: not holding down option runs this: export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH doing now "{query}" and and holding down option runs this export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH doing later "{query}" Is there a better way i could be doing this? at the moment the keyword is "doing" followed by the input. I'm also happy to type "doing now" and "doing later" followed by the input if this can be accomplished in one script or with some variable etc. Forgive how basic this is but it will help me learn. Thank you!!! Link to comment
deanishe Posted November 25, 2021 Share Posted November 25, 2021 1 hour ago, sepulchra said: Is there a better way i could be doing this? I don’t think so. I’ve never used doing, so I’m not sure, but there doesn’t seem to be a whole lot you could do to make it simpler/faster to use. A shorter keyword, perhaps? .d would be a good choice if you use it a lot (starting keywords with . is generally guaranteed to result in zero regular search results, so it will take you straight to your workflow). If you wanted to push the boat out, I guess a history feature would be a sweet touch. So the workflow remembers all the previous tasks you entered and suggests them when you run it. 1 hour ago, sepulchra said: Forgive me as I am learning here If you have any questions, fire away. Link to comment
sepulchra Posted November 27, 2021 Author Share Posted November 27, 2021 (edited) Thanks @deanishe I ended up modifying the worklflow with your keyword suggestions, and added another script for "doing note" which adds a note to the last task. I also broke out the commands into separate keyword triggers. I’m going to put a link to the workflow here in case any other doing user wants to make it better. I’m sure someome might! https://www.dropbox.com/s/93iwa5h5es7lw6c/Doing.alfredworkflow?dl=0 Edited November 27, 2021 by sepulchra deanishe 1 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