login | register | search | print |
Snippets
Documentation > SnippetsFor all sample, you can jump to the complete $ directives...
Feel free to add you own stuff here !?
Hello world sample
All can be replaced with SHA1 or whatever.
Create md5 using wdhash
The result will be a file with "md5 hash" added as extension. From toto.txt a file toto.txt.b17925a0f74e68509d18f31e79c89891 will be created in the same folder !
Alternative ... you can produce a MD5 check file and use it as TCBL entry :
here $1 is a parameter passed from the command line ( it could be %T or %P from TC.)
Control md5 using wdhash and previously calculated files or check file
use -p as option to pause before end !
- $x is the file without extension
- $e is the extension
- $!...[$x]$! is ...wdx called with the file without extension (original file in our case)
First, you should install image magick
In the folowing samples, the installation path of imagemagick is : C:\tools\graphic\ImageMagick\ ++Change with your own path !++
++CAUTION++
All command with mogrify.exe modify your file ! Do backup before trying..
;add ImageMagik in the path
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=mogrify.exe -quality 75 $f
;add ImageMagik in the path
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=mogrify.exe -rotate -90 $f
;add ImageMagik in the path
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=mogrify.exe -rotate 90 $f
;add ImageMagik in the path
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
pre=set img_resize="50%"
cmd=mogrify.exe -resize "%img_resize%" $f
;add ImageMagik in the path
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=convert -size 100x100 $f -colors 128 -thumbnail x100 -resize "100x<" -despeckle -transparent white -sharpen 3 $x_th.gif
;add ImageMagik in the path
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=convert.exe $f $x.png
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=convert $f -limit memory 1 -limit map 2 -thumbnail 300x300 -bordercolor white -border 150 -gravity center -crop 300x300+0+0 +repage -flatten -quality 75 -sharpen 3 -despeckle $x_fld.jpg
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=convert $f -limit memory 1 -limit map 2 -thumbnail 200x200 -bordercolor white -border 100 -gravity center -crop 200x200+0+0 +repage -flatten -quality 75 -sharpen 3 -despeckle $x_fld.jpg
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=convert $f ( +clone -background black -shadow 75x4+3+3 ) +swap -background white -mosaic +repage $z_shadowed.$e
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
pre=set img_resize="50%"
cmd=convert -caption "$1" $f -thumbnail 5000x500 -bordercolor "#EFEFEF" -border 10x10 -density 144 -gravity center -pointsize 15 -background black -polaroid -10 -resize "%img_resize%" -background white -mosaic +repage $p\PolaroidC_$n
pre=set PATH=C:\tools\graphic\ImageMagick\;%PATH%
cmd=convert $f -thumbnail 240x240 -bordercolor white -background black +polaroid -background white -mosaic +repage $p\Polaroid_$n
Buttoncount=1
button1=%commander_path%\icons\menubar\tcbl\mkv.ico
cmd1=""%commander_path%\addons\tcmd\tcbld\tcbl.exe" -I "%commander_path%\.scripts\tcbl\file.ini""
param1=%L "listing" "%T\genlist.xls"
menu1=Filelist
pre=echo off
pre=echo id fullfilename name parent gparent ggparent sizeB sizeKB sizeMB sizeGB datetime ext > "$1"
cmd=echo $i
cmd=set /A myi=$i+1
cmd=echo $i $f $n $p1 $p2 $p3 $!%Size@DirSizeCalc.wdx%$! =G%myi%/1024 =G%myi%/(1024*1024) =G%myi%/(1024*1024*1024) $#m $e >> "$1"
Buttoncount=1
button1=%commander_path%\icons\menubar\tcbl\mkv.ico
cmd1=""%commander_path%\addons\tcmd\tcbld\tcbl.exe" -i
param1=%L "csv_01" "%T\list.csv"
menu1=Csvlist
; get output from first parameter do no exec, do not quote and keep file
ini= 1 1
ini=o $1
ini=x
ini=q
ini=k
; generate header for csv
pre=id;fullfilename;name;size KB; date time;ext
cmd=$i;"$f";"$n";$#SK;$#m;$e