[TxMt] drag commands
Allan Odgaard
throw-away-1 at macromates.com
Sun Oct 1 09:40:26 UTC 2006
On 30/9/2006, at 22:38, marios wrote:
> [...] How do I change the code, so it uses a different Variable in
> these cases ?
> (for instance, in this case, using a different variable like
> $TM_LOCAL_URL instead of $TM_REMOTE_URL)
You can do something like:
if [[ "$TM_MODIFIER_FLAGS" = *OPTION* ]]
then BASE="$TM_LOCAL_URL"
else BASE="$TM_REMOTE_URL"
fi
Then in your command use "$BASE" (which will be the local URL when ⌥
is down).
> echo -n "<a href=\"http://$TM_REMOTE_URL/file_download/\${1:file_id}\"
> title=\"\${2:`ruby -e 'print
> ENV['\''TM_DROPPED_FILE'\''].gsub(/^(.*\/)/,String.new)'`}\">\${3:\
> $2}</a>"
>
> Also , I tried to modify the code so it strips off the file-extension
> from the third variable doing the usual TM Transformation,
> but then I get an Error , gsub complaining.
Just paste an example of the desired result.
More information about the textmate
mailing list