Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- :: Set the paths and other params
- set "INPUT_DIR=C:\path\to\input\png\files"
- set "OUTPUT_DIR=C:\path\to\output\txt\files"
- set "APP_PATH=python.exe"
- set "PY_SCRIPT=uborder-tool.py"
- set "OPTIONAL_PARAMS=-t 50"
- set "OUTPUT_FILE_EXT=slangp"
- :: Check if directories exist
- if not exist "%INPUT_DIR%" (
- echo Input directory does not exist: %INPUT_DIR%
- pause
- exit /b
- )
- if not exist "%OUTPUT_DIR%" (
- echo Output directory does not exist: %OUTPUT_DIR%
- pause
- exit /b
- )
- :: Process each PNG file in the input directory
- for %%F in ("%INPUT_DIR%\*.png") do (
- :: Get the base name of the file (without extension)
- set "BASENAME=%%~nF"
- :: Define the output file path
- set "OUTPUT_FILE=%OUTPUT_DIR%\!BASENAME!.!OUTPUT_FILE_EXT!"
- :: Run the app with the input PNG and output paths
- echo Processing "%%F" to "!OUTPUT_FILE!"...
- "%APP_PATH%" "!PY_SCRIPT!" "%%F" -o "!OUTPUT_FILE!" "!OPTIONAL_PARAMS!"
- )
- echo All files processed.
- pause
Advertisement
Add Comment
Please, Sign In to add comment