[TxMt] drag commands

marios tmtxpstuff at consking.com
Wed Oct 11 22:07:06 UTC 2006


I had forgotten to include the modifier key flags.
Also to make this command  a little bit more useful, I added a Filetype
variable
that can be used, to add some extra text behind the title.
It uses shift to distinguish between the base Urls, which when not set
up will default to example.com.

base="${TM_DROPPED_FILE/%.*/}"
title="${base##*/}"
FILETYPE=" Download"
url2="www.example.com"
url1="${TM_REMOTE_URL:-$url2}"
url="${TM_LOCAL_URL:-$url2}"
if [[ "$TM_MODIFIER_FLAGS" = *SHIFT* ]]
        then BASE="$url"
        else BASE="$url1"
fi
echo -n "<a href=\"http://\${1:$BASE}/file_download/\${2:file_id}\"
title=\"\${3:$title}$FILETYPE\">\${4:$title}$FILETYPE</a>
"

I'm trying to figure out, how it can be done, so it does bulk inserting
as well, in spite the fact, that they have tab stop variables, but still
no go.
(May be with sed ?)
 
regards, marios

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Zip Drag command 3.tmDragCommand.zip
Type: application/zip
Size: 809 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20061012/daaff899/attachment.zip>


More information about the textmate mailing list