FileFactory by WhiteWind description

FileFactory v0.3beta - plugin for TotalCommander and separate application, intended for complex file processing, such as:

- search and replace with regular expressions, file name and search results
- formatting using easy but powerfull script language,
- support for TotalCommander WDX plugins, report generation.

## WARNING

Since program is unstable, I strongly recommend you to back up your files before using Multi-rename and Search and Replace!

See description of the script language and regular expressions

In case of troubles: program strores Ini-files path in the registry in section HKEY_LOCAL_MACHINE\SOFTWARE\WhiteWind\FileFactory\. You can find there and change paths to TotalCommander's ini and to FileFactory's ini.

## Interface description

There is two tabs on the main window: Report and Search and Replace and four buttons at bottom: Open files, Open file list, Run and Close.

Open files button cleares current file list and shows "Open file" dialog.
Open file list button allows you to load file list from file. File names are separated by line breaks.
Run button action depends on current tab: on the Report tab it launches report generation, and on the Search and Replace tab it starts renaming and/or search and replace.
Close button is self-explanatory.

Report tab is intended for report generation. You can use it, for example, for generation of playlists, html table of contents, bat files for mass file operations, descript.ion files, etc.
Report file name filed contents name of report file. If file already exists, you will be asked for overwrite confirmation.
You can check Overwrite checkbox to disable this confirmation.
Before field contents script, which result will be placed at the beginning of report.
Script, contained in the File filed will run for each file.
Result of the After script will be written at the end of report.
There is current file list on the right.
In the Presets section you can save and load parameters all parameters that present on this tab, except file list. Just select preset from drop down list to load it. If you want to save preset, press "+" button and enter name of the preset. Press "-" button to delete current preset.
In the bottom right corner you can see Example field, in which you can see the results of the applying the File script to first file in list.

On the Search and Replace tab you van perform multi-rename and/or Search and Replace. Flags description:

Rename | Turns on/of renaming. If this flag is unchecked then files not renamed, Search and Replace is performed in source files and all fields that refer to renaming are disabled. WARNING!You can not undo the changes in modified files!
Keep old files | Files are not reanamed but coppied. Search and replaces will be applied to new files, old files will remain unchecked.
Create dirs | Create directories according to '/' and '\' characters. If this flag is unchecked and target directory does not exists, an error will raise.
Overwrite | If this flag is checked then all files will be overwritten without confirmation.
Search & replace | This flag enables/disables Search and Replace. If this flag is unchecked then files remain unmodified and fields Search for and Replace with become deisabled.
Ignore spaces | Spaces in search expression ignore gaps in text (space equals \s*).
Regular expressions | Search with or without Regular Expressions.

You should enter script in the New file name field, results of this script will be the new file name. If new file name is relative then it is relative to path that is contained in %BaseDir% variable.
Below is list of old files with corresponding new file names.

In the field Search for you can enter regular expression that will be searched. You also may leave this field blank, then whole file contents will be replaced with results of the script contained in Replace with field.

Section Presets has the same meaning as on the previous tab, but is independent. This mean that parameters of Report and Search & Replace are stored separately.

## WDX plugins and autocompletion

In first launch program tries to find TotalCommander ini file. If it's found, program writes it's path to the registry. The list of WDX plugins is taken from this file. You can access them in script using folowing syntax: %<PluginName>.<FieldName>.<FieldUnits>% (last parameter is not required) for example:
`%Images.Width%`

If you type % and wait a little, list of internal variables and WDX plugins appears, if you type period after name of the plugin, then list of it's fields appears. Also you can access this list by pressing Ctrl+Shift+Space (only between % and %).

If you type $ then list of functions appears, this list is also accessed by Ctrl+Space hotkey (only after $).

## Parameters or command line

-p, --preset | Name of preset. If you provide only preset name (with extention *.prs or *.prr) then it will be taken from 'presets' directory, which is located in the program directory. Else it will be treated as full path to preset file. .prs extension means Search & Replace preset, and .prr extension means Report preset.
-r, --report | Report file name. Report will be written to this file.
-l, --list | Path to file with list of files to be processed. File names must be separated by line breaks.
-s, --subdirs | Process files from subdirectories.
FileMask | Mask or name of directory.
Example: FF.exe -p images.prr -r images.html C:\images\*.jpg -s

You may set the preset from TC "Pack files" dialog by writing preset name after archive name and "/" symbol.

## Third party components:

SynEdit 2.0.3 http://synedit.sourceforge.net
TRegExpr 0.952 http://RegExpStudio.com/