Way to use a Finder hot key to open a folder in TextMate

keyboardtextmate

I have setup a System Preferences -> Keyboard -> Keyboard Shortcuts -> Services item to allow me to use a hotkey to "Open in TextMate". It works fine on files, but does not work on folders.

If I Control+Click on the same folder, select "Services" from the pop-up menu and choose "Open in TextMate" the folder is opened as a project in TextMate. This is exactly what I'm looking for. Is there a way to setup a shortcut to have the same open folder as project behavior as the Control+Click method?

Best Answer

I think that's a bug with Finder. Services that receive folders as input don't seem to be listed in the Services menu when folders are selected (but it only applies to column view; they are listed in other view modes).

In any case, one alternative would be to just use an AppleScript without wrapping it as a service. You can give it an app-specific shortcut with FastScripts.

try
    tell application "Finder"
        open (get selection) using path to application "TextMate"
    end tell
end try