Opening Files and Folders in Textmate 2 From Finder
In case it’s ever useful to anyone else, here’s how to right-click open any number of files and folders in Textmate 2 from the OSX Finder:
- Make sure you’ve installed the Shell support, in Textmate 2’s Preferences / Terminal
- Open the Automator app and create a new Service.
- Locate and add two actions: “Get Selected Finder Items” and “Run Shell Script”.
- Configure the Service so it receives selected “files or folders” in “Finder.app”. And make the shell run the following:
while read file; do /usr/local/bin/mate "$file"; done
Screenshot of the Service:
Finally, save the Service as “Open in Textmate”. You’ll now be able to right-click (or command-click) open files and folders in Textmate 2 from Finder — including hairy ones with spaces in their name.