I've the following case where I select files to be processed by a command line tool with options.
It's usually always the following command line: "tool.exe [options set] [path]original_file.txt [options set] [path]result_file.txt"
I've seen on the wiki that TC supports scripting but frankly I don't quite get it and couldn't get it to work.
I would appreciate if someone can give a simple script I can just plug-in.
How to batch automate a command line tool on selected files
Moderators: Hacker, petermad, Stefan2, white
Re: How to batch automate a command line tool on selected files
E.g. you can use such BAT file:
It will apply command for every selected file and pass path to the file and path to it in an opposite panel, with other parameters that are written in third line. If you remove echo word from third line, it will execute command instead of just printing it, also you can remove pause command.
Code: Select all
@echo off
if -%1==- echo Parameters: %%WL "%%T" & pause & goto :EOF
for /f "usebackq delims=" %%f in (`type "%~1"`) do echo tool.exe [options set] "%%~f" [options set] "%~2\%%~nxf"
pause
Re: How to batch automate a command line tool on selected files
If you want to create ans run a batch file from selected files, you can use TCBL using %L to pass all the selected files.
If the script is simple you can use a simple command line as a user command or button in TC.
if you need something more complicated or keep it for multiple uses, you can define in tcbl.ini a command section.
-- Limitations:
If the script is simple you can use a simple command line as a user command or button in TC.
if you need something more complicated or keep it for multiple uses, you can define in tcbl.ini a command section.
-- Limitations:
- only works with real files
- only use %L or %F to get list of file (no support to Utf-8/Unicode %UL,%WL) and be aware of TC bug Max len of line is 260 Byte.
- need small learning time (I will be pleased to help.)