(Feature Request) textmate integration
Asked by Jocelyn Mallon:

Another feature I'd love to see in SourceTree is integration with textmate, still today one of the most popular "programmers" text editors on Mac OS X.

Ideally this would have two main functions, the first would open a repository in textmate as a new project. And the second, would be the reverse, to open a textmate project in sourcetree.

My favorite implementation of this is actually from the open source app gity (<http://gityapp.com/>) in that it has a menu item to open project in textmate, and this creates a new textmate project, retaining the existing source structure, etc.


Answers:
author: stevestreeting
body: Nice idea, if a little bit niche. Unfortunately in Lion (via the sandbox), Apple is locking down Apple events so that apps can only listen to events and not send them to other apps, although right now there are 'temporary' exceptions. So far, I already use these for talking to Terminal (and iTerm/iTerm2), which I'm claiming exceptions for. However, I won't be adding any more Apple event dependent functionality like this until I see how this pans out - it's not clear right now whether these rules will be relaxed or tightened later on, and I don't want to add features I subsequently have to take away again.

comments: author: Jocelyn Mallon
body: Hi and thanks for the fast response.

That's rather unfortunate, but understandable. I did some browsing of the gity source, and noticed they simply call the textmate commandline tool, so this leads to another through, applescript. Yes it would be an extra step for the end-user (but easy enough, especially for the type of user that would want textmate integration) but it should be possible via applescript, if sourcetree supports applescript in the future.

Do the new sandbox restrictions prevent applescript support and/or do you have any plans to add applescript support to sourcetree?


author: stevestreeting
body: The sandbox allows an application to *receive* Apple events (say, from a script a user creates and invokes), but does not allow it to *send* Apple events to other applications. This is a problem, because it effectively prevents integration work between apps. I've raised a bug report with Apple to suggest that they should treat this case like access to the Keychain, thus allowing a user to grant an application access to send events to another application, but I'm still waiting for a response. So far you can ask for exceptions for specific apps (I've done this for Terminal and iTerm since SourceTree already supports invoking those), but these are marked as temporary, so I don't know what the longer-term prognosis is. I hope we'll know more about their intentions soon, developers are getting quite frustrated with their silence.


author: Sheldon Els
body: I can see how this would effect opening textmate, but the reverse would be doable via a textmate plugin that fires up SourceTree on a folder, as well as possibly adding a bookmark to that folder. Similar to the current behaviour of a 'open -a SourceTree \<folder\>'. Would this be something you'd be interested in? I'd happily put one together if you want.


author: Andy Brook [Plugin People]
body: The line you'll get is that Feature Requests go to: <https://jira.atlassian.com>, translation, unless you find a developer to write such stuff as a plugin its generally unlikely to happen any time soon in the core project.