View Single Post
Old 11-21-2011, 12:34 AM   #15
Ponderz
Junior Member
Ponderz began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2011
Device: Sony Clie SJ20
My conversion script. Put into Sendto folder.

I got a sendto batch file that is working for me. Hope someone can use it.

rem Get all parameter into variable
rem Will get only 15 parameters.
rem Out file to same directory as source.

if exist M:\ap\Calibre2\ebook-convert.exe set calibre=M:\ap\Calibre2\ebook-convert.exe
if exist d:\ap\Calibre2\ebook-convert.exe set calibre=d:\ap\Calibre2\ebook-convert.exe

set count=0


IF NOT (%1)==() (
SET p1=%1
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%2)==() (
SET p2=%2
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%3)==() (
SET p3=%3
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%4)==() (
SET p4=%4
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%5)==() (
SET p5=%5
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%6)==() (
SET p6=%6
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%7)==() (
SET p7=%7
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%8)==() (
SET p8=%8
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%9)==() (
SET p9=%9
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%10)==() (
SET p10=%10
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%11)==() (
SET p11=%11
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%12)==() (
SET p12=%12
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%13)==() (
SET p13=%13
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%14)==() (
SET p14=%14
) ELSE (
set /a count+=1 && goto begin
)
IF NOT (%15)==() (
SET p15=%15
) ELSE (
set /a count+=1 && goto begin

:begin

echo count:%count%
echo p1:%p1%
echo p2:%p2%
echo p3:%p3%
echo p4:%p4%
echo p5:%p5%
echo p6:%p6%
echo p7:%p7%
echo p8:%p8%
echo p9:%p9%
echo p10:%p10%
echo p11:%p11%
echo p12:%p12%
echo p13:%p13%
echo p14:%p14%
echo p15:%p15%

IF (%p1%)==() set /a count+=1 && GOTO END
IF NOT (%p1%)==() start /wait /min %calibre% %p1% %p1%.epub --no-default-epub-cover --use-auto-toc

IF (%p2%)==() set /a count+=1 && GOTO END
IF NOT (%p2%)==() start /wait /min %calibre% %p2% %p2%.epub --no-default-epub-cover --use-auto-toc

IF (%p3%)==() set /a count+=1 && GOTO END
IF NOT (%p3%)==() start /wait /min %calibre% %p3% %p3%.epub --no-default-epub-cover --use-auto-toc

IF (%p4%)==() set /a count+=1 && GOTO END
IF NOT (%p4%)==() start /wait /min %calibre% %p4% %p4%.epub --no-default-epub-cover --use-auto-toc

IF (%p5%)==() set /a count+=1 && GOTO END
IF NOT (%p5%)==() start /wait /min %calibre% %p5% %p5%.epub --no-default-epub-cover --use-auto-toc

IF (%p6%)==() set /a count+=1 && GOTO END
IF NOT (%p6%)==() start /wait /min %calibre% %p6% %p6%.epub --no-default-epub-cover --use-auto-toc

IF (%p7%)==() set /a count+=1 && GOTO END
IF NOT (%p7%)==() start /wait /min %calibre% %p7% %p7%.epub --no-default-epub-cover --use-auto-toc

IF (%p8%)==() set /a count+=1 && GOTO END
IF NOT (%p8%)==() start /wait /min %calibre% %p8% %p8%.epub --no-default-epub-cover --use-auto-toc

IF (%p9%)==() set /a count+=1 && GOTO END
IF NOT (%p9%)==() start /wait /min %calibre% %p9% %p9%.epub --no-default-epub-cover --use-auto-toc

IF (%p10%)==() set /a count+=1 && GOTO END
IF NOT (%p10%)==() start /wait /min %calibre% %p10% %p10%.epub --no-default-epub-cover --use-auto-toc

IF (%p11%)==() set /a count+=1 && GOTO END
IF NOT (%p11%)==() start /wait /min %calibre% %p11% %p11%.epub --no-default-epub-cover --use-auto-toc

IF (%p12%)==() set /a count+=1 && GOTO END
IF NOT (%p12%)==() start /wait /min %calibre% %p12% %p12%.epub --no-default-epub-cover --use-auto-toc

IF (%p13%)==() set /a count+=1 && GOTO END
IF NOT (%p13%)==() start /wait /min %calibre% %p13% %p13%.epub --no-default-epub-cover --use-auto-toc

IF (%p14%)==() set /a count+=1 && GOTO END
IF NOT (%p14%)==() start /wait /min %calibre% %p14% %p14%.epub --no-default-epub-cover --use-auto-toc

IF (%p15%)==() set /a count+=1 && GOTO END
IF NOT (%p15%)==() start /wait /min %calibre% %p15% %p15%.epub --no-default-epub-cover --use-auto-toc

:end

echo count:%count%
Ponderz is offline   Reply With Quote