I'm not sure of the folder structure you have.
Quote:
Originally Posted by mysteryminds As a test I've tried placing some 5 images under 1 sub folder1 and 3 files under sub folder 2 --> Folder 1
under folder 2 -->
subfolder 1 --> 3 images
subfolder 2 --> 5 images |
You say 5 images under "
1 sub folder1" but show "
subfolder 2" --> 5 images. So are the 5 images in "
1 sub folder1" or "
subfolder2"?
You say 3 files under "
sub folder 2" but show "
subfolder 1" --> 3 images. So are the 3 images in "
sub folder 2" or "
subfolder 1"?
I'm not sure what the
sub folder 2 -->
Folder 1 means
I'm not sure where
Folder 1 fits in.
To process the files in a group of subfolders, you have to drag and drop the parent folder onto the batch file.
Or open a command prompt, switch to the directory that contains the batch file, then type the name of the batch file with the complete quoted path to the parent folder.
Quote:
Originally Posted by mysteryminds Job d:\scanned\folders |
It looks like this is what you are doing, so I'm not sure why it's stopping after doing just one folder, unless gimp is stopping the batch file somehow.
Might need to have the batch file wait for gimp to finish. It may be trying to cue up several instances which isn't working.
Try adding
start /w to the gimp line so the batch file will wait:
start /w gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
Here's how I tested:
Save the batch file as
JOB.bat in
C:\Scripts.
The parent folder is
D:\Scanned\folders
So this is the structure I created:
Code:
D:\Scanned\folders
+---Folder 1
¦ +---Subfolder 1
¦ ¦ +---Sub-Subfolder 1
¦ +---Subfolder 2
¦ +---Sub-Subfolder 1
+---Folder 2
¦ +---Subfolder 1
¦ ¦ +---Sub-Subfolder 1
¦ +---Subfolder 2
¦ +---Sub-Subfolder 1
Run the batch file by switching to the
C:\Scripts folder and type this:
JOB "D:\Scanned\folders"
Or, drag the
D:\Scanned\folders folder and drop it onto
C:\Scripts\JOB.bat:
This will be the output (I've just echoed the gimps command, but this shows it changes folders. The prompt showing the current folder is in blue:
Code:
C:\Scripts>tree "D:\Scanned\folders"
Folder PATH listing for volume XP MCE
Volume serial number is 8008-D527
D:\Scanned\folders
+---Folder 1
¦ +---Subfolder 1
¦ ¦ +---Sub-Subfolder 1
¦ +---Subfolder 2
¦ +---Sub-Subfolder 1
+---Folder 2
¦ +---Subfolder 1
¦ ¦ +---Sub-Subfolder 1
¦ +---Subfolder 2
¦ +---Sub-Subfolder 1
C:\Scripts>JOB "D:\Scanned\folders"
D:\Scanned\folders\Folder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 1\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 2\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 1\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 2\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
Press any key to continue . . .
C:\Scripts>
This does not do the files that are in the parent folder,
D:\Scanned\folders. If that folder also contains files, use this version:
Code:
@Echo Off
If [%1]==[] Goto _Usage
If Not Exist "%~1" Goto _Usage2
If Not Exist %~s1\nul Goto _Usage1
Set _Source=%1
Mode CON: Cols=100 Lines=30
Title Processing %_Source% and it's subfolders
PushD "%_Source%"
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
For /F "Tokens=1 Delims=" %%I In ('Dir /AD /B /S %_Source%') Do (
PushD "%%I"
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
PopD
)
Pause
Goto :EOF
:_Usage2
Echo Error: %1 does not exist.
Goto _Usage
:_Usage1
Echo Parameter Error: %1 is a file name.
Echo : Please specify a folder name
:_Usage
Echo.
Echo %~n0 [drive:][path]foldername
Echo.
Echo. foldername : Name of the folder to process.
Echo. : It must be quoted if it contains spaces and is entered
Echo. : on the Command Line. If dropped on the batch file or it's
Echo. : shortcut, it will be quoted automatically
Echo.
Pause
This is the output, showing it will also process
D:\Scanned\folders:
Code:
C:\Scripts>JOB "D:\Scanned\folders"
D:\Scanned\folders> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 1\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 2\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 1\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 2\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
Press any key to continue . . .
C:\Scripts>
For logging, it depends on what you want logged, a list of all files processed, or just the folders that were processed.
Set a variable to the path and name of the log file right before or after the Set _Source= line:
Set _LogFile=C:\My log files\GimpsDeskew.log
Add the appropriate command right before or after the GIMP command:
You can Echo the current folder name inside the loop:
>>"_LogFile" Echo %CD%
If you want a list of files, you can do a Dir inside each folder:
>>"_LogFile" Dir /A-D /B *.jpg
Jerry