Search images in subfolders and convert
Posted: 2018-10-29T04:14:24-07:00
I have put together a simple script, which when used on the direct parent folder of the files, works fine:
It searches for jpg, png and tifs in a folder and converts to a pdf, renaming it as folders name.
Now how would I go about doing the same thing, but searching through various subfolders, instead of the direct parent?
Example:
Folder Top (<- search through this folder)
- Sub Folder A
- image_1.jpg
- image_2.jpg
- Sub Folder B
- image_3.tif
- image_4.tif
- Sub Folder C
- image_5.png
- image_6.png
So this should end up in three pdfs: Sub Folder A, Sub Folder B and Sub Folder C
I do hope that makes sense. Many thanks
Code: Select all
cd %~dpnx1
for %%a in (.) do set currentfolder=%%~na
magick "*jpg*" "*png*" "*tif*" "%currentfolder%.pdf"
Now how would I go about doing the same thing, but searching through various subfolders, instead of the direct parent?
Example:
Folder Top (<- search through this folder)
- Sub Folder A
- image_1.jpg
- image_2.jpg
- Sub Folder B
- image_3.tif
- image_4.tif
- Sub Folder C
- image_5.png
- image_6.png
So this should end up in three pdfs: Sub Folder A, Sub Folder B and Sub Folder C
I do hope that makes sense. Many thanks