TCBL new version (1.04 )

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

TCBL new version (1.04 )

Post by *nsp »

I've done a small utility for TC and other file manager.

This tool get a list of file, build and launch a batch according to some options and parameters.

You can get latest version here
Latest version(update only)
Lexer file for synwrite tcbl.lcf

More details :
this is a lst2multi replacement with more features !

A) Why should i use it ?
- I want to execute some command from TC toolbar with more than one file (the %l %L).
- The command i want to execute is an internal shell command.
- I want to execute more than one command for each file.
- ....
Personnaly i use inside TC to launch a lot of imagemagick command resize,rotate,contrast...

B) is it easy to use ?
- if you know how to do thing with a dos console you are able to use it !


C) Why a bat/cmd file is used :
- you can use all system command (echo, ren, copy, move, .... ) depending
of your command interpreter.
- the -e option allow you to edit in notepad the created batch in order
to complete / modify before execution.

- the -E option allow you to use a bat file to edit the created batch in order
to complete / modify before execution.


___________________________________________________

for more : http://tccfestuff.free.fr

Create a new toolbar button

TC) Sample : create a "Copy of " Files :
Command : TCBL.exe
parameter : %L copy $f "$p\Copy of $n"

TC) Sample : create rotated images (With ImageMagick)
Command : TCBL.exe
parameter : %L mogrify -rotate 90 $f

TC) Sample : create a reducted images (With ImageMagick)
Command : TCBL.exe
parameter : %L convert -resize 50% $f $x_small.$e

TC) add ".inactive" at the end of a file
Command : TCBL.exe
parameter : %L ren $f $n.inactive

TC) remove the extension of a file
Command : TCBL.exe
parameter : %L ren $f $z

TC) create a liste of selected file name
Command : TCBL.exe
parameter : %L -q echo $f $AC:\SelectedFiles.txt

=====
in French :
J'ai fait un petit programme qui peut être utilisé en conjontion avec TC... C'est un programme qui utilise "Fichier selectionnés" %L et construit un batch à partir de cette liste. C'est très pratique pour les boutons....

Si cette utilitaire vous semble util, le voici..... http://tccfestuff.free.fr
l'aide n'est pour l'instant qu'en Anglais si c'est utile, je rajouterai des explication en francais.


_________ History ________
// the new version is beta 1.03//
- some Fix for $; separator on command line
- update slre code

- added ini parmeter t to set console title

// the new version is beta 1.03//
- some Fix for 64 bit OS version (clipboard)
- Date/Time format fixes (32/64 version)

// the new version is beta 1.03//
fix some 64bit version crash.
fix some formatting issues
fix file chooser bugs.

add intervals for file index and file size on cmd filter (tcbl.ini cmds)

// the new version is beta 1.01//
First 64bit version without support of wdx and slower. As it does not use many memory this is alsmot useless but tis is 64bit...

-- added raw file index 1...xxx not altered by ini config
-- speed optimisation for list processing
-- changed from PellesC to TDM mingw gcc compiler.

// the new version is 1.01//
-- added File choser option for ini file using internal variable
-- update for slre regexp library
-- bugfix for replacement of variable in ini parameters

// the new version is beta 0.999//
-- minor bugfix with filters
-- switched to slre 1.2 for speed improvement
-- added new path commands $p#1, $p#2... $p#9
-- upxed exe

// the new version is beta 0.998//
-- minor bugfix
-- added graphical input box and internal parameters ($_1..$_9)
-- ability to use parameter inside filter definition

// the new version is beta 0.991//
-- speed improvement for large file
-- Added $K to get clipboard content
// the new version is beta 0.990//
-- Some bugfixes on filtering and initialization
-- Added multiple filtering capabilities in ini file
// the new version is beta 0.985a//
-- bugfix on folder sent with terminating \
-- some bugfix on very large file list
-- speed improvment

// the new version is beta 0.983++//
-- Added precision for filesize options in ini part.
-- Added calculation Scheme for b Kb Mb Gb (SI or base 2^10)
-- Added decimal separator ,

// the new version is beta 0.982//
-- Added noQuote options in ini part.

// the new version is beta 0.980//
-- Added ini section by command template.

Code: Select all

ini= nStart nStep (Initialize the file counter to nStart and set nStep as step ! )
ini=# TimeFormatStr (Initialize time format for file information )
ini=C codepage (set codePage. )

ini=o outputfile (file used as output)
ini=a outputfile (file used as output in append mode. The file will not be deleted.)

ini=k (Keep output file )
ini=d (	delete output file, specially used in append mode. )


ini=x Command to Execute (command used to launch output file )
ini=X Command to Execute with all parameter (command used to launch output file using $- inside command.)
ini=x (do not execute any command)

-- bugfix when file name contains "$?" in some specific sequence.

// the new version is beta 0.965//
fix replacement of % sign in file
fix some filtering issue
fix bug with very large input file (>1000 files)

add ini section to set file counter start and step
add Odd and Pair files based on file counter

Q option do not quote and not replace %sign in filename
k option to keep generated file
e option use you default editor to edit the bat file.

add $p*n and $p+n commands to have path replacement more complete...


// the new version is beta 0.96//
fix: some bug around quote
code rewrite and new C compiler...


// the new version is beta 0.95//
added : file attributes and dates $shortcuts
added : List File $shortcut
added : file/folder filter for ini scripts
added : call SuperWDX plugin with alternate file

fix: multiple calls

// the new version is beta 0.90//
added : added disk and folder $command
fix: filtering on filename, path, .... using topic key
fix: tcblEdit.bat sample

beta 0.86//
fix: usage of %% was faulty in previous version.

// beta 0.83//
added : alternate ini files for command
added : support for super_wdx column (no language support)

//beta 0.82//
added : TCBL.ini with extended syntax file in order to externally store scripts.
added : Super_WDX support (use your wdx plugins to build command ! )
added : file filter for command (execute command only for filtered files)
...
bugFix: listFile.lst can ends without \n ;)
...

-- 0.6
Added ini file support.
Change from lcc win32 to pellesC.
Modified quote manager.
Bug correction.

-- 0.5
Structure Section :
' $( ' is the separator between prefix and repeated commands.
' $) ' is the separator between repeated and postfix commands.
$; is the separator between 2 line.

Counter Section :
$i is the file index 1 to 99999999.
$c is the file counter 0001 to 9999.
$C is the file counter 000000001 to 999999999.

Date Time Section :
$D is the day number dd.
$M is the month number mm.
$Y is the year number yyyy.
$w is the week day.
$W is the week number.
$d is the date yyyymmdd.
$t is the time hhmmss.
$T is the long date and time.
__________________________
Last edited by nsp on 2016-06-26, 14:07 UTC, edited 34 times in total.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Do you know the MakeBat plugin by TC author?
http://www.totalcmd.net/plugring/makebat.html

I think that we have a standalone version now. ;)

Icfu
This account is for sale
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

icfu wrote:Do you know the MakeBat plugin by TC author?
http://www.totalcmd.net/plugring/makebat.html

I think that we have a
[/i]version now. ;)

Icfu
Yes ;) event if notice it abter building tcbl.
The make bat does not launch the bat automatically and do not delete it after excecution.....

For so i did this small standalone version.

The aim was to automate exceution for toolbar button (for my wife at first, and I to replace a lot of .cmd file i used with lst2str... a bunch of people only use one finger stick to the mouse..;).[\i]

icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

@nsp:
To use a $ in a command, use $$ instead.
When using $$, it is replaced with $. ($dot), looks like a bug.

Icfu
This account is for sale
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

2nsp: it's nice!

With -e could you make it start the shell open command handler for txtfile instead of notepad? On my system .txt is associated with my preferred editor.

OT but since you do a lot of command-line image editing, have you found a good way to visually compare image files side-by-side?
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

quote="icfu"]@nsp:
When using $$, it is replaced with $. ($dot), looks like a bug.
Icfu[/quote]

The new version remove this bug ! thx for pointing it !
sgp wrote: With -e could you make it start the shell ...
I've added a -E that launch tcblEdit.bat file must be in the same folder as tcbl.exe.

Code: Select all

edit %*
or

Code: Select all

@c:\dev\txt\wscite\scite.exe %*

or whatever you want....
sgp wrote: OT but since you do a lot of command-line image editing, have you found a good way to visually compare image files side-by-side?
In fact to compare images i mostly use html pages. The display is done by my favorite WebBrowser (K-Meleon) using side by side image at the same size.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

The new version remove this bug ! thx for pointing it !
Sure, thanks for the fix! :)

Have you thought about uploading your tool to totalcmd.net? I think it would deserve more users. In the forum nice tools get buried too soon 'cause nobody knows that they exist...

Icfu
This account is for sale
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

new Version

Post by *nsp »

icfu wrote:[
Have you thought about uploading your tool to totalcmd.net? I think it would deserve more users. In the forum nice tools get buried too soon 'cause nobody knows that they exist...
Icfu
I do not know how to have an acount in Totalcmd.net in order to upload it... if someone have an how to ??

by the way i've done a new version http://ghisler.ch/board/viewtopic.php?t=9374&highlight=tcbl
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

I do not know how to have an acount in Totalcmd.net in order to upload it... if someone have an how to ??
Just contact Ergo, best way is by ICQ:
http://www.ghisler.ch/board/viewtopic.php?t=8007

Icfu
This account is for sale
\/4D3R
Junior Member
Junior Member
Posts: 20
Joined: 2005-05-19, 20:13 UTC

Post by *\/4D3R »

is it possible for you to make use of %commander_path%?

currently i am using it in the start menu:

menu8=-Addons - Image Magick - Image Manipulation
menu9=Addons - Image Magick - Resize 50%
cmd9=%commander_path%\addons\tcbl\TCBL.exe
param9=%L C:\xp\util\tcmd\addons\imagick\convert.exe -resize 50%%%% $f %T$z.50percent.$e
menu10=Addons - Image Magick - Resize 150%
cmd10=%commander_path%\addons\tcbl\TCBL.exe
param10=?%L C:\xp\util\tcmd\addons\imagick\convert.exe -resize 150%%%% $f %T$z.150percent.$e
menu11=Addons - Image Magick - Rotate 90° to Right
cmd11=%commander_path%\addons\tcbl\TCBL.exe
param11=%L C:\xp\util\tcmd\addons\imagick\mogrify.exe -rotate 90 $f
menu12=Addons - Image Magick - Rotate 90° to Left
cmd12=%commander_path%\addons\tcbl\TCBL.exe
param12=%L C:\xp\util\tcmd\addons\imagick\mogrify.exe -rotate -90 $f
menu13=Addons - Image Magick - Rotate 180°
cmd13=%commander_path%\addons\tcbl\TCBL.exe
param13=%L %commander_path% C:\xp\util\tcmd\addons\imagick\mogrify.exe -rotate

would be a lot easier (usb stick) to use %commander_path% instead of e.g. C:\xp\util\tcmd\

thx
TychoBarfy
Senior Member
Senior Member
Posts: 340
Joined: 2005-08-13, 15:13 UTC
Location: Berlin, Germany
Contact:

Post by *TychoBarfy »

Own sample - description:
Backup button in TC Buttonbar. There a command with parameters will be
passed to TCBL, to copy all marked files into a folder named with
format yyyy_mm_dd_hhmmss (i.e. backup_2006_10_23_125905).

Buttonbar entry:
Command:%COMMANDER_PATH%\tc_tools\tcbbl\tcbl.exe
Parameter:%L xcopy /Y/H/R/I/Q $f "%Tbackup_$Y_$M_$D_$t\*.*"
Icon file:%COMMANDER_PATH%\icons\whatyoulike.icl,10
Tooltip:Copy to folder yyyy_mm_dd_hhmmss in target panel

Unfortunately it copies only files. So if I mark some folders it
copies only the files in the last of the marked folder, and if this
folder contains a subfolder, this subfolder will not be copied.
If I add the /E switch I get duplicates of all subfolders.

Any ideas how to make it work to copy all marked files and/or
folders including the subfolders?

-------------- EDIT ------------
Alternatively I made a batch file which does the same but copying
all files and folders of the actual dir into the new and formated folder in target panel.
According to this thread: http://ghisler.ch/board/viewtopic.php?t=2395

Code: Select all

@echo on
setlocal
for /F "tokens=1-4 delims=. " %%i in ('date/T') do set dd=%%i&set mm=%%j&set yyyy=%%k
set d=%yyyy%_%mm%_%dd%
for /F "tokens=1-2 delims=: " %%l in ('time/T') do set t=%%l%%m
xcopy "%1*.*" "%2backup_%d%_%t%\*.*" /Y/H/R/E/Q
endlocal
delims=. is because I'm working on a german system (date to convert is i.e. 23.10.2006).

I call it from Startermenu passing "%P %"T as parameters.
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

TychoBarfy wrote:Own sample - description:
Backup button in TC Buttonbar. There a command with parameters will be
passed to TCBL, to copy all marked files into a folder named with
format yyyy_mm_dd_hhmmss (i.e. backup_2006_10_23_125905).

Code: Select all

Parameter:%L xcopy /Y/H/R/I/Q $f "%Tbackup_$Y_$M_$D_$t\*.*"
Hi,

I'm pleased you use tcbl ;)

I have a similar Backup faclities... I've just a different parameter :

Code: Select all

Buttonbar entry:
Command:%COMMANDER_PATH%\tc_tools\tcbbl\tcbl.exe
Parameter:%L echo F$Pxcopy /Y/H/R/I/Q/S/E/I $f "%Tbackup_$Y_$M_$D_$t\$n"
Icon file:%COMMANDER_PATH%\icons\whatyoulike.icl,10
Tooltip:Copy to folder yyyy_mm_dd_hhmmss in target panel
Decoding....
if you copy a file with fullly qualified name, xcopy ask if it is a file or a folder... (in my system the response for a File is F ) you probably have to modify it in your german system. this is the "Echo F"
$P is for pipe "|"

For the xcopy command :
The /I is needed for copying folder to folder !
use /S/E to have the complete snapshot of the selected folder.

Hope this help.
TychoBarfy
Senior Member
Senior Member
Posts: 340
Joined: 2005-08-13, 15:13 UTC
Location: Berlin, Germany
Contact:

Post by *TychoBarfy »

"echo F$Pxcopy"
How can I find out what xcopy on a german system is waiting for? F doesn't work.
F = File (would be D = Datei in german but this doesn't work :D )

BTW another question. Must $f be included in double quotes in case there's a path or file name with spaces?

EDIT: And yet another question. Must I give xcopy a switch like /EXCLUDE:"%Tbackup_$Y_$M_$D_$t\" to avoid enless copying if I have the same path in both panels?
Don't need it, because xcopy does nothing if one has the same path in both panels.
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

TychoBarfy wrote:"echo F$Pxcopy"
How can I find out what xcopy on a german system is waiting for? F doesn't work.
To see what xcopy is waiting :
on a cmd window,
create a file text.txt
and try to us xcopy like : xcopy text.txt oldText.txt
Xcopy will ask does oldtext.txt is a F = file or a D directory...
the leter behind the "German File" is the anwser !

$f is by deault the full name of the file if if contain space or extended letter, it is quotted automatically
TychoBarfy wrote: EDIT: And yet another question. Must I give xcopy a switch like /EXCLUDE:"%Tbackup_$Y_$M_$D_$t" to avoid enless copying if I have the same path in both panels?
Don't need it, because xcopy does nothing if one has the same path in both panels.
I've never faced this ;) but i think you are right you can exclude the folder itself if by any change you have already created a flder at the same second !
TychoBarfy
Senior Member
Senior Member
Posts: 340
Joined: 2005-08-13, 15:13 UTC
Location: Berlin, Germany
Contact:

Post by *TychoBarfy »

OK thanks. The letter for the echo is D -> %L echo D$P. But the button doesn't work. No directory is created nor files are copied.

Code: Select all

Command:%COMMANDER_PATH%\tc_tools\tcbbl\tcbl.exe
Parameter:%L echo D$Pxcopy /Y/H/R/I/Q/S/E/I $f "%Tbackup_$Y_$M_$D_$t\$n"
Starting path:[empty or not]
Tooltip:Blabla
Post Reply