franzheidl Posted February 12, 2013 Share Posted February 12, 2013 (edited) Most certainly about a dozen people have done this already, but being too lazy to look these up I made my own Use Keyword "cdh" to cd into your currently open Finder directory. To run a Terminal Command , use "cdh [your command]". If there is no folder currently open in Finder, your command will be run in your Desktop folder. The Workflow will look for a non-busy Terminal window and use it before opening a new one. http://cl.ly/NjL6 https://github.com/franzheidl/alfred-workflows Edited March 25, 2013 by franzheidl Enhorn 1 Link to comment
franzheidl Posted February 13, 2013 Author Share Posted February 13, 2013 Just fixed a bug that prevented the Workflow from running properly on the Desktop in case there's no folder open in Finder. Pull from https://github.com/franzheidl/alfred-workflows or use updated download link above. Sorry for the inconvenience, goes to show there's no thing like proper testing :/ Link to comment
franzheidl Posted March 17, 2013 Author Share Posted March 17, 2013 (edited) Update: The workflow will by default execute your command in the first non-busy Terminal window it finds, otherwise open a new one. I have just added the option to explicitly run the command in a new Terminal window, just press [alt] when firing your command in Alfred 2. Either pull from https://github.com/franzheidl/alfred-workflows.git, or use the updated downlowd link: http://cl.ly/NjL6 Edited March 21, 2013 by franzheidl Link to comment
rolandleth Posted March 20, 2013 Share Posted March 20, 2013 (edited) Thanks for the workflow! Needs a fix though Should replace if theQuery is not "" then with if (theQuery as string) is not "" then Otherwise it always takes the then route. Edited March 20, 2013 by rolandleth Link to comment
franzheidl Posted March 21, 2013 Author Share Posted March 21, 2013 (edited) Well spotted! This did slip through since it doesn't break the resulting behaviour, except for the double ampersands being piped through to the Terminal. Just fixed this, pull from https://github.com/franzheidl/alfred-workflows.git or use the updated download link: http://cl.ly/NjL6 (also updated the ldownload links in previous posts) Edited March 21, 2013 by franzheidl Link to comment
crisb Posted March 27, 2013 Share Posted March 27, 2013 How difficult would it be to adapt this to work with applications other than Finder -- ie. to open/start a terminal session in the directory where the frontmost application's currently-open document (if it has one) is located? This might make it possible to replace Dterm (since Alfred seems to be replacing so many of my other tools, why not?). Link to comment
franzheidl Posted March 28, 2013 Author Share Posted March 28, 2013 Shouldn't be too difficult I think. Will give this a go next week, I'm currently away without my machine. Do you imagine this more like a workflow of its own, an additional keyword/modifier to this one, or even as default behavior in case Finder is not the frontmost application? Link to comment
crisb Posted March 28, 2013 Share Posted March 28, 2013 @franz: Thanks. I was thinking in terms of this being the default behaviour. However before spending any time on this you might want to check out a related thread where someone's already posted something very close to what I'm after. It doesn't re-use existing Terminal windows like your workflow does, but is very functional as-is. Link to comment
franzheidl Posted April 5, 2013 Author Share Posted April 5, 2013 (edited) Sounded useful enough for me to give it a whirl. Currently on it and looking good so far. There's some other things I'd love to include with the next version of this workflow, so bear with me Edited April 5, 2013 by franzheidl 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