deanishe 1,394 Posted June 12, 2014 Share Posted June 12, 2014 (edited) Sublime Text Projects Filter and open your Sublime Text (2 and 3) project files. It can be tricky getting .sublime-project files to work with File Filters, as Sublime Text doesn't register the extension as a proper filetype. This workflow solves that problem. It can easily be duplicated and adapted to other filetypes with the same problem. Note: The new version (2014-06-16) also finds files in hidden directories (with a little configuration). Installation Download the workflow from GitHub or Packal. Usage .st [<query>] — List/filter your .sublime-project files ↩ — Open result in Sublime Text ⌘+↩ — Reveal file in Finder .stconfig — Show the current settings .sthelp — View the included help file Note: You can currently only alter the settings by editing the settings.json file by hand. Hit ↩ on the Edit Configuration item to open it in your default JSON editor. Licensing, thanks All the code is released under the MIT Licence. The icons are by dmatarazzo. Changelog 2014-06-16 Add ability to search in hidden directories and other directories excluded from Spotlight's index Add ability to filter out certain results (via globbing patterns) Add ability to get your hands dirty editing the JSON config file Edited June 16, 2014 by deanishe Link to post
deanishe 1,394 Posted June 16, 2014 Author Share Posted June 16, 2014 Significant update. See OP. No longer as simple (to write) as I'd hoped, but the workflow now supports finding files in hidden directories. Link to post
MrMoins 1 Posted July 22, 2014 Share Posted July 22, 2014 Thank you for this workflow ! The problem is when a project is launched by this workflow the workspace is empty. It would be great if we could have the previous state of workspace, like "subl my-project.sublime-project" command in a terminal session Link to post
deanishe 1,394 Posted July 23, 2014 Author Share Posted July 23, 2014 (edited) That would be ideal, but the problem with that is it would require that the subl command has been linked to /usr/local/bin/. It could use subl from within the application bundle, but what is the workflow supposed to do if both ST2 and ST3 are installed? The workflow will open the .sublime-project file with whatever application you have set to open that type of file. So if you want that to be the subl command, create an application with Automator with a Run Shell Script action that calls subl with the passed file. Set that as the default application for .sublime-project files and it will have the added advantage of also restoring the workspace when double-clicking a .sublime-project file in Finder. Edited July 23, 2014 by deanishe Link to post
sudopeople 5 Posted August 20, 2015 Share Posted August 20, 2015 Superb! Thanks very much! Link to post
jdno 0 Posted February 17, 2016 Share Posted February 17, 2016 That would be ideal, but the problem with that is it would require that the subl command has been linked to /usr/local/bin/. It could use subl from within the application bundle, but what is the workflow supposed to do if both ST2 and ST3 are installed? The workflow will open the .sublime-project file with whatever application you have set to open that type of file. So if you want that to be the subl command, create an application with Automator with a Run Shell Script action that calls subl with the passed file. Set that as the default application for .sublime-project files and it will have the added advantage of also restoring the workspace when double-clicking a .sublime-project file in Finder. Thanks for that tip! Makes this workflow really awesome. Can you include it on the Packal page? Link to post
TUpton98 1 Posted December 22, 2016 Share Posted December 22, 2016 Any ideas how I would extend this to also open a terminal window based on the folder that the .sublime-project file exists in? Link to post
xilopaint 73 Posted March 30, 2017 Share Posted March 30, 2017 (edited) I have got high CPU usage many times with update_cache.py: Edited June 22, 2019 by xilopaint Link to post
deanishe 1,394 Posted March 30, 2017 Author Share Posted March 30, 2017 Yes. Alfred-Workflow's background API doesn't get along with Sierra. I'm at a bit of a loss as to how to fix it, as I don't have Sierra, so I can't reproduce the problem. Link to post
deanishe 1,394 Posted April 3, 2017 Author Share Posted April 3, 2017 See here for a easy workaround till I can update all my workflows. Link to post
mrchow19910319 1 Posted August 25, 2017 Share Posted August 25, 2017 @deanishe hey, I am using your sublime workflow for a long time. May I ask you that how do I change it a bit, so the default sublime text option opens a new sublime text window for me on my current desktop? Now whenever I hit enter it will point me to my already opened sublime window. Thanks in advance. Link to post
deanishe 1,394 Posted August 26, 2017 Author Share Posted August 26, 2017 The answer to your question is a few posts above yours. Link to post
mrchow19910319 1 Posted August 26, 2017 Share Posted August 26, 2017 33 minutes ago, deanishe said: The answer to your question is a few posts above yours. You got me confused... your workflow above, (in the original post ) if I've already had a sublime window opened, can only direct me to my existing sublime text window. I need the workflow to open new blank window everytime I key in: sublime. Could you make one workflow that does these: whenever keyed in: subl, open new blank sublime window in the active desktop. No matter whether the app is already opened. open with sublime text (just like the old one) find and open with sublime text (just like the old one) Link to post
deanishe 1,394 Posted August 26, 2017 Author Share Posted August 26, 2017 Sorry. I was half-awake and misread your question. 7 hours ago, mrchow19910319 said: Could you make one workflow that does these: No. But this script does what you want: tell application "Sublime Text" if it is running then tell application "System Events" tell process "Sublime Text" to click menu item "New Window" in menu "File" of menu bar 1 end tell end if end tell -- Activate doesn't work with Sublime on Sierra do shell script "open -a 'Sublime Text'" Link to post
mrchow19910319 1 Posted August 26, 2017 Share Posted August 26, 2017 (edited) 5 hours ago, deanishe said: Sorry. I was half-awake and misread your question. No. But this script does what you want: tell application "Sublime Text" if it is running then tell application "System Events" tell process "Sublime Text" to click menu item "New Window" in menu "File" of menu bar 1 end tell end if end tell -- Activate doesn't work with Sublime on Sierra do shell script "open -a 'Sublime Text'" Okay this worked. Thank you so much! Edited August 26, 2017 by mrchow19910319 Link to post
deanishe 1,394 Posted February 15, 2019 Author Share Posted February 15, 2019 (edited) Just released v3. Rewrote the workflow in Go for much speed Add ability to open project folders New, prettier icons Edited February 15, 2019 by deanishe xilopaint 1 Link to post
xilopaint 73 Posted July 16, 2019 Share Posted July 16, 2019 (edited) @deanishe, could you make a new release now you got added support for VSCode? Edited July 16, 2019 by xilopaint Link to post
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