[txmt-dev] Re: TM2 enhanced txmt:// url scheme ideas

Allan Odgaard mailinglist at textmate.org
Thu Sep 6 17:35:11 UTC 2012


On Sep 5, 2012, at 10:37 AM, Hans-Jörg Bibiko <bibiko at eva.mpg.de> wrote:

> […] How about to enhance this url scheme to support other "hosts" like "open"?

Well, I think the URL scheme should be for more “global” actions. Not per-document actions, since there is no good way to specify what document we wish to work on, and also, this seems a bit like just hacking in some poor man’s scripting system using something which is not meant for it, e.g. the security issue you mention (which just tax general use and make it useless outside a TM context despite being a global URL scheme).

> […] using an internal TM session ID which is accessible via a TM_ shell variable.
> This session ID will be generated if TM2 starts, any command invoked from TM2 knows that ID and passes it through the txmt:/ url back to TM2; and the method "handleTxMtURL" simply checks the internal against the passed one.

If this is for commands with HTML output we already have a TextMate JavaScript object. This seems better to use for communication than a global URL scheme: https://github.com/textmate/textmate/blob/master/Frameworks/HTMLOutput/src/helpers/HOJSBridge.mm#L42

I haven’t given scripting API that much thought, but if we add it, let’s try to do it right :)

There’s a major challenge though in figuring out what exactly should be used, AppleScript is just so God damn awful, but sort of the only system for “scripted” application IPC. Though it might be bearable if used with AppScript.



More information about the textmate-dev mailing list