[TxMt] drag commands

marios tmtxpstuff at consking.com
Mon Oct 9 09:39:08 UTC 2006


Regarding to the previous drag command:

In order for this to work correctly, freehand editing mode must not be
enabled while dragging. (Thanks Allan)
Then it works right out of the box, even while dragging fast.

However, I wanted to have the command, so it also strips off double and
triple file extensions for the title attribute, as often the case with
archive files,
changing the code a little in the substitution pattern.
I inserted also an additional tab stop value for the URL and added a
fall-back value(www.exampe.com) in case $TM_REMOTE_URL
is unset.
A newline is also inserted after the last tab-trigger.


base="${TM_DROPPED_FILE/%.*/}"
title="${base##*/}"
url2="www.example.com"
url1="${TM_REMOTE_URL:-$url2}"
echo -n "<a href=\"http://\${1:$url1}/file_download/\${2:file_id}\"
title=\"\${3:$title}\">\${4:$title}</a>
"



Command is attached.

I was thinking, that it would be terrific, to make those commands, so
the can do bulk inserting as well.
May be that would be possible, by setting a counter for the tab-stop
variables so they increment automatically for each bulk dropped file.


regards, marios
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Zip Drag command 2.tmDragCommand.zip
Type: application/zip
Size: 731 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20061009/d95bf2cc/attachment.zip>


More information about the textmate mailing list