Facilities be damned, you need a Batchroom!
The Toad’s Batchroom: Batch scripts for files and folders processing
Current repository comprizes various batch files created for my personal use, and appeared to be so useful that I even update and improve them from time to time.
Main batch files
Most batchfiles are equipped with GUI, some intended to be used as templates for further editing. Most frequently used are:
-
dir ffmpeg flac2ogg 48 - converts all .flac within chosen folder and subfolders to .ogg 48 kHz, using ffmpeg. Other dir ffmpeg flac2ogg scripts in this repository do similar conversion except for settings, which you hopefully may figure out from their names.
-
dir OPTIVORBIS ogg - recompress all .ogg within chosen folder and subfolders, using OPTIVORBIS; saves up to 10% of .ogg size.
-
dir LibreOffice rtf2docx - batch conversion of .rtf, .doc, .odt and .fb2 files to .docx using LibreOffice. Overcomes clumsy LibreOffice idea of exporting all files into one dir, as well as some other clumsy LibreOffice ideas.
-
dir COMPACT LZX - Windows only; makes Windows (ver. 8 and 10) compact.exe recompress selected folder and subfolders using LZX filesystem compression. Great for software installations - for modern bloatware compression ratio is typically 2.0-2.7, sometimes higher. No sense to use it on frequently updated docs and stuff - upon editing and saving file gets decompressed back.
[!NOTE] Windows users may rename forementioned files from .py to .pyw to avoid starting console.
Programs dir COMPACT LZX, dir OPTIVORBIS ogg and dir ffmpeg flac2ogg 48, beside having Tkinter-based GUI, are capable to accept command line arguments at start time. Argument is supposed to be a name of folder; in this case program GUI opens right in this folder. If argument happen to be a file, GUI will be opened in folder containing it. You may this capability by creating shortcuts likepythonw.exe "dir COMPACT LZX.py.py" "%1"and then simply drag-and-drop folders onto shortcut to open program right where you need it.
If argument is absent (e.g., you simply double-click program), program simply opens GUI in default directory and wait for you to browse and point to required location.
-
dir AdvZIP docx - recompressing .docx after dir LibreOffice rtf2docx using AdvZIP gives up to 10% space saving.
-
dir RENAME untranslit - batch renaming, intended for Russian users. Программа для оптового переименования (batch renaming) файлов с транслитерированными именами обратно с латиницы на русский (кириллицу). Не соответствует ISO 9, словари переименования составлены на основе того, с чем я лично сталкиваюсь.
[!CAUTION] Будьте крайне осторожны, никогда не направляйте программу dir RENAME untranslit на директории типа Windows или Program Files! Всю систему она вам, конечно, не переименует, но многое изгадить успеет.
- dir RENAME unflibusta - batch renaming of files according to patterns, like replacing underscores with spaces, removing digits, and so on. Edit rules pattern to your need.
[!NOTE] dir RENAME unflibusta.py was initially created to batch fix silly filename convention for files downloaded from Flibusta and is supposed to be edited at will as you encounter any other silly file naming scheme.
Sanctifier
Sanctifier actually is not a batch script but self-contained pure Python PNG to ICO converter, developed for assembling Windows icon (.ICO) files from PNG files without introducing any changes to the latter. The main idea is that Sanctifier simply inserts compressed PNG data into ICO skeleton as is, keeping source compression. This allows you to compress source PNGs to maximum degree first, and then use them to assemble multiple image single file ICO of minimal size, following simple steps below:
- Create your PNG files and save them into one folder.
- Optimize PNG files thus created (oxipng is highly recommended).
- Start Sanctifier.py, select PNGs to assemble your ICO, follow hints displayed in info string of GUI.
Links
The Toad’s Slimy Mudhole website - more Python freeware for 2D image processing, POV-Ray and other 3D, and batch automation by the same author.
