[TxMt] Absolute path with $TM_DROPPED_FILE?

Allan Odgaard throw-away-1 at macromates.com
Wed Nov 23 02:59:10 UTC 2005


On 23/11/2005, at 3:47, Kyle Barrow wrote:

> I've only been using TextMate a day, like it, but am struggling to  
> find resources on $TM_DROPPED_FILE, etc.

Most “missing” documentation is in the release notes (Help -> Show  
Release Notes):

----------8<----------
When the command is executed, the normal TM-variables are available  
and additionally there is:

    TM_DROPPED_FILEPATH: the absolute path of the file dropped.
    TM_DROPPED_FILE: relative path of the file dropped (relative to  
the document directory).
    TM_MODIFIER_FLAGS: the modifiers which were held down when the  
file got dropped. This is a bitwise or in the form: “SHIFT|CONTROL| 
OPTION|COMMAND” (in case all modifieres were down).

The current directory is set to that of the document.
---------->8----------

> In HTML, I would like links created with $TM_DROPPED_FILE to use  
> absolute not relative paths to the project root and I would  
> appreciate any info on how to do this.

I'd think you want: "${TM_DROPPED_FILEPATH#$TM_PROJECT_DIRECTORY}"

This should chop off the project directory from the path of the  
dropped file.




More information about the textmate mailing list