[TxMt] Open URL
Freek Dijkstra
freek at macfreek.nl
Sun Dec 11 23:41:39 UTC 2005
>>> First of all, open URL:
>>> I'm used to clicking on a URL in a text and go to that URL in a
>>> webbrowser.
>> For this there is "Open URL" in the Services menu, look at this hint
>> to assign a shortcut to it:
>> http://www.macosxhints.com/article.php?story=20040416191600412
>
> It's also easy to make a custom command to open the selected URL. I
> put one inside my Text bundle. Here's the entire thing:
>
> open "$TM_SELECTED_TEXT"
>
> Both of these solutions do require the URL to be selected first. A
> version that didn't require that (i.e. you could simply place the
> caret inside the URL) would be nice, but a bit more work.
Thanks for both hints!
However, I still prefer to have a "Open URL" in a contextual menu, for
two reasons:
1. I can still use it without assigning a shortcut key (I admit that
I probably am a minority, given TextMate heavily key-based operation,
but I do like to use my mouse)
2. I think it is less clumsy then the other options, e.g. (a) hack
/System/Library/CoreServices/SystemUIServer.app/Contents/Info.plist
(as the macosxhints suggests; I don't mind hacking /Library, but DO
mind hacking /System). (b) Install ICeCoffEE (which provides
system-wide ⌘-click behaviour, but forces to install Application
Enhancer (APE)) (c) Forces me to first select the URL.
3. It is in-line with other Editors, like Apple's TextEdit, Apple's
Stickies, BareBones' BBEdit, TheCodingMonkeys' SubEthaEdit, TeXShop,
-- in short most other editors I know of :-)
As a side-note: This is what the readme of ICeCoffEE told on this subject:
> Apple has provided ⌘-click URL opening in Mac OS X 10.2 and later in two places.
>
> Apple’s Multilingual Text Editor (MLTE) service lets you ⌘-click URLs to open them. Apple’s FileMaker Pro 7 is an example of an application which uses MLTE.
>
> Terminal lets you use ⌘-double-click URLs to open them.
I'm fine with either way (context menu with "Open URL", ⌘-click or
⌘-double-click); alternatively, I recommend that TextMate does not
underline URL's if it does not threat them special -- I found it utterly
confusing that I got a visual clue that they were special, but could not
act upon that.
Regards,
Freek
More information about the textmate
mailing list