Good news, progress is occurring but I need your assistance again!
Check out the below - everything is now running, right up until we get to where it runs "sed"- which is in another directory so I don't think it's finding it and I'm not sure how to fix that. I tried creating another "set sed=C:\"program files\blah\blah" but that didn't work for me when I ran it the second time. The next error after sed, is when it calls "echoRestore" which it says is not a recognized command or batch file. Do you know why it suddenly wouldn't be able to find that directory again?
Many thanks, we are almost there!
c:\Images>call %PICTBAT%guillotine.bat pat_crp.png subs_XX.png White 2 . 1
c:\Images>rem From image pat_crp.png, guillotines into pieces.
c:\Images>set PICTBAT=C:"\Program Files\ImageMagick-7.0.5-Q16\pictbat\"
c:\Images>rem @call echoOffSave
c:\Images>call C:"\Program Files\ImageMagick-7.0.5-Q16\pictbat\"setInOut pat_crp
.png guil
c:\Images>setlocal DisableDelayedExpansion
c:\Images>set INFILE=c:\Images\pat_crp.png
c:\Images>if not exist "c:\Images\pat_crp.png" set INFILE=pat_crp.png
c:\Images>endlocal & set INFILE=c:\Images\pat_crp.png
c:\Images>setlocal DisableDelayedExpansion
c:\Images>if "" == "1" (
echo INFILE=c:\Images\pat_crp.png
echo INFILEBANG=c:\Images\pat_crp.png
echo OUTFILE=c:\Images\pat_crp_guil.png
echo INNAME=pat_crp
echo BASENAME=c:\Images\pat_crp
echo EXT=.png
)
c:\Images>endlocal
c:\Images>if not "subs_XX.png" == "" if not "subs_XX.png" == "." set OUTFILE=sub
s_XX.png
c:\Images>call C:"\Program Files\ImageMagick-7.0.5-Q16\pictbat\"guilFind pat_crp
.png . White 2 . 1
c:\Images>rem From image pat_crp.png, returns list of ordinates to guillotine in
to pieces.
c:\Images>set PICTBAT=\pictbat\
c:\Images>rem @call echoOffSave
c:\Images>call \pictbat\setInOut pat_crp.png guil
The system cannot find the path specified.
c:\Images>for /F %F in ("subs_XX.png") do set OUTFILE=%~dpnF.lis
c:\Images>set OUTFILE=c:\Images\subs_XX.lis
c:\Images>if not "." == "" if not "." == "." set OUTFILE=.
c:\Images>set TMPTXT1=c:\Images\pat_crp_guil1.lis
c:\Images>set TMPTXT2=c:\Images\pat_crp_guil2.lis
c:\Images>set TEMP_IMG=c:\Images\pat_crp_guil.png
c:\Images>set BACK_COL=White
c:\Images>if "White" == "." set BACK_COL=
c:\Images>if "White" == "" set BACK_COL=White
c:\Images>set FUZZ=2
c:\Images>if "2" == "." set FUZZ=
c:\Images>if "2" == "" set FUZZ=0
c:\Images>set NON_BACK=.
c:\Images>if "." == "." set NON_BACK=
c:\Images>if "" == "" set NON_BACK=0
c:\Images>set DIRN=1
c:\Images>if "1" == "." set DIRN=
c:\Images>if "1" == "" set DIRN=0
c:\Images>if 1 == 0 (
set ROT_IN=
set ROT_OUT=
) else (
set ROT_IN=-rotate -90
set ROT_OUT=-rotate 90
)
c:\Images>if 2 == 0 (set sFUZZ= ) else (set sFUZZ=-fuzz 2% )
c:\Images>Magick convert c:\Images\pat_crp.png -strip -rotate -90 -fuzz
2% -alpha set -transparent White -channel RGB -evaluate set 100% +channel
-background Black -layers Flatten -scale "x1^!" -fuzz 0% -fill Black -op
aque Black -fill White +opaque Black c:\Images\pat_crp_guil.png
c:\Images>if not "" == "" (
set /A MG=/2
magick convert c:\Images\pat_crp_guil.png -negate -morphology Dista
nce:-1 Chebyshev:1,1 -black-threshold !MG! -fill White +opaque Black
-negate c:\Images\pat_crp_guil.png
)
c:\Images>if "" == "1" magick convert c:\Images\pat_crp_guil.png -negate -
morphology Distance:-1 Chebyshev:1,1 -auto-level -fill Black +opaque White
-negate c:\Images\pat_crp_guil.png
c:\Images>for /F "usebackq tokens=3 delims=x+" %C in (`magick convert c:\Image
s\pat_crp_guil.png -quiet -bordercolor Black -border 1 -format "%@" info
:`) do (set /A OFFSET=%C-1 )
c:\Images>(set /A OFFSET=193-1 )
c:\Images>echo guilFind: OFFSET=192
guilFind: OFFSET=192
c:\Images>magick convert c:\Images\pat_crp_guil.png -quiet -crop 0x1+192+0
+repage -morphology Thicken:-1 Skeleton -transparent White sparse-color:c
:\Images\pat_crp_guil1.lis
c:\Images>sed -e 's/ /\n/g' c:\Images\pat_crp_guil1.lis 1>c:\Images\pat_crp_gui
l2.lis
'sed' is not recognized as an internal or external command,
operable program or batch file.
c:\Images>type c:\Images\pat_crp_guil2.lis
c:\Images>set nCUTS=0
c:\Images>(for /F "tokens=1 delims=, " %X in (c:\Images\pat_crp_guil2.lis) do (
set /A V=%X+192
echo !V!
set /A nCUTS+=1
) ) 1>c:\Images\subs_XX.lis
c:\Images>echo guilFind: nCUTS=0
guilFind: nCUTS=0
c:\Images>type c:\Images\subs_XX.lis
c:\Images>call echoRestore
'echoRestore' is not recognized as an internal or external command,
operable program or batch file.
c:\Images>endlocal & set guilOUTFILE=c:\Images\subs_XX.lis & set guilNUM_CUTS
=0
c:\Images>if ERRORLEVEL 1 exit /B 1
c:\Images>