[TxMt] drag command for inserting links to local files

Rob McBroom textmate at skurfer.com
Wed May 9 20:54:30 UTC 2007


I created this a while back, but I had forgotten about it until a  
recent discussion of Drag Commands.

If you're using the pre-insalled Apache under Mac OS X, the  
DocumentRoot is set to `/Library/WebServer/Documents/`. I try to  
avoid attachments as much as possible, so I'll usually put a file in  
that location and just send people a URL that leads them to it. To  
make this easier, I created a Drag Command that applies to any file  
in that directory. For example, if I drop /Library/WebServer/ 
Documents/some.zip in a document, it inserts http:// 
kendra.oit.gatech.edu/some.zip instead.

It's currently scoped to "text.mail,text.html" and I usually only use  
it for e-mail, but perhaps it should be scoped for all "text"?  
Anyway, I thought this might be a useful addition to the Mail or Text  
bundle.

On a related note, what's the preferred way to say "I thought this  
might be a useful addition to the XYZ bundle"? :)

FYI - If you're looking at the command and wondering why all the  
gymnastics to get the Fully Qualified Domain Name for the local  
machine, it is intended to work in either of these situations:

   1. `hostname` returns something appropriate, like "kendra" and  
`domainname` returns something appropriate like "oit.gatech.edu".

   2. `hostname` erroneously returns the FQDN (like  
"kendra.oit.gatech.edu") and `domainname` returns nothing at all.  
(For reasons unknown, I think most systems are misconfigured like  
this by default.)

---
Rob McBroom
<http://www.skurfer.com/>
I didn't "switch" to Apple... my OS did.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mail Link.tmDragCommand
Type: application/octet-stream
Size: 894 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20070509/b559fb32/attachment.tmDragCommand>
-------------- next part --------------



More information about the textmate mailing list