phyllisstein Posted January 13, 2013 Share Posted January 13, 2013 Hello, workers of flow! I've converted an old extension to a workflow, and thought you might like to give the results a shot. Open in Sublime defines the subl keyword. If you enter a path, it'll open that file in Sublime Text 2; if you select something in the frontmost Finder window and enter the keyword, it'll open the selected files or folders; and if you enter the keyword without anything selected or a path, it'll open the frontmost Finder window's folder in Sublime. If you've tried this before, be aware that I redid the AppleScript so that it now ought to work properly with Finder selections. Let me know if you have any problems! I'm @phyllisstein on Twitter and d-at-daniel-dot-sh if that's easier. garyh 1 Link to comment
viticci Posted January 13, 2013 Share Posted January 13, 2013 Very nice! Super useful with the File Buffer for me. Link to comment
BrianGilbert_ Posted January 26, 2013 Share Posted January 26, 2013 hey phyllisstein, the search workflow link is dead Link to comment
phyllisstein Posted January 27, 2013 Author Share Posted January 27, 2013 hey phyllisstein, the search workflow link is dead Oops! I'm afraid I deleted it from my Droplr—and apparently, also from Alfred. There's a much better workflow by bigluck, in AlfPT, that uses the feedback system to list and open recent projects. The search workflow I'd had was just a file filter linked to `subl -p "{query}"`. Link to comment
BrianGilbert_ Posted January 27, 2013 Share Posted January 27, 2013 ah, no problem I'll use that one then Link to comment
phyllisstein Posted March 15, 2013 Author Share Posted March 15, 2013 Just updated this workflow so that it'll check to see whether Sublime Text 2 or 3 is installed (defaults to 3) instead of failing if you had the wrong version. Download at the link above. Link to comment
AMeijer Posted March 15, 2013 Share Posted March 15, 2013 Thank you very much! Wouldn't it be nice to open files/folders immediately from Alfred, within having to use the Finder window? Similiar to the "open {query}" keyword shortcut. Like so: subl MySite (open the MySites folder with Sublime) or subl index.php (open index.php file with Sublime) Unfortunately i'm not very good with AppleScript, otherwise i'd give it a try myself Link to comment
phyllisstein Posted March 15, 2013 Author Share Posted March 15, 2013 Thank you very much! Wouldn't it be nice to open files/folders immediately from Alfred, within having to use the Finder window? Similiar to the "open {query}" keyword shortcut. Like so: subl MySite (open the MySites folder with Sublime) or subl index.php (open index.php file with Sublime) Unfortunately i'm not very good with AppleScript, otherwise i'd give it a try myself You should be able to do this by entering the complete POSIX path to the file after the `subl` keyword. So for example, I just tested: subl "~/Dropbox/" "~/Documents/" and it seemed to work fine. Does that give you any trouble on your end? Link to comment
nikipore Posted March 17, 2013 Share Posted March 17, 2013 phyllisstein, I've played a little bit with your workflow and boiled it down to a plain vanilla Alfred thing plus a trivial bash script which also addresses AMeijer's question (he actually wanted Alfred to select things him, I suppose). Best, Jan Link to comment
phyllisstein Posted March 19, 2013 Author Share Posted March 19, 2013 phyllisstein, I've played a little bit with your workflow and boiled it down to a plain vanilla Alfred thing plus a trivial bash script which also addresses AMeijer's question (he actually wanted Alfred to select things him, I suppose). Best, Jan Aha, I gotcha. That's actually a much more sensible way to do it! I'll have to see if I can't modify the shell script to check for ST2/3—not tonight, but soon. Link to comment
phyllisstein Posted May 18, 2013 Author Share Posted May 18, 2013 (edited) Hey all! I've just made some small changes to the workflow so that it can take advantage of alp's fuzzy searching functions, making it a bit faster and smoother. Otherwise things are mostly unchanged. Download the update through Alleyoop or at http://alfred.daniel.sh/Workflows/OpenInSublime.alfredworkflow The keywords are "subl" to list and open recent projects or the current Finder selection and "sub*" to do a Spotlight search for any file and pass it to Sublime. There's also an optional hotkey to open the Finder selection in Sublime immediately (mine's set to "⌥+⌘+↓"). Edited May 18, 2013 by phyllisstein Link to comment
guiguan Posted May 20, 2013 Share Posted May 20, 2013 Awesome. I need such workflow badly. LOL Link to comment
phyllisstein Posted May 20, 2013 Author Share Posted May 20, 2013 After pushing the last update, I got a lovely e-mail from raguay.customct with a great improvement to this workflow that adds PathFinder support to the "subl" keyword and the hotkey. You can download it via Alleyoop or at http://alfred.daniel.sh/Workflows/OpenInSublime.alfredworkflow . Thanks Richard! 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