View Single Post
Old 12-19-2008, 04:10 PM   #124
koland
Grand Sorcerer
koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.koland ought to be getting tired of karma fortunes by now.
 
Posts: 8,560
Karma: 8033155
Join Date: Aug 2008
Location: TN, USA
Device: kindle(all), nook, nookcolor, Sony, Kobo, epic, iphone, iPad, pc
Quote:
Originally Posted by pilotbob View Post
You can have your for command call another batch file which does multiple commands. I don't think there is a way to have a block of commands in a for... but wouldn't be suprised if it were possible.

Also, I'm confused, why would they all be called book.html? Or you mean... <bookname>.html were book name is different for each book.

Tell us what you are trying to do and I'm sure I can help with the batch commands to do it in one pass.
Thanks Bob, but I'm not having any problems. I typed in the command in a command box for about a week before automating it all with command files.

I use two command files (the first is a FOR command that calls the second and passes in the name of the book, minus the extension). The second does the conversion (actually, I have two pairs of these - one for mobi, one for ereader). The ereader conversion creates html files (with images extracted) and you can name the directory, but the main html file is always called "book.html" (this is set in the script and apparently can't be passed in as a parameter). It isn't a big deal to do a rename of that in the batch file that does the actual conversion. Mobidedrm does allow you to specify the destination filename, but can't be exactly the same as the original, unless they are in different directories. Again, the batch file takes care of all that for me.

It's the people trying to have only one batch file that run into limitations - the FOR command can only do what is on that one command line, so what it calls must do all the other processing. No doubt I could just rewrite the python commands to do what I want, but there isn't any need when it's just as easy to maintain a tiny batch file (which is then easily changed anytime I want; editing 4 or 5 lines is much easier than messing with the python script, especially if you want to try to integrate version changes people come up with for it).
koland is offline   Reply With Quote