I have the following macro:
(It turns a Gutenberg .txt format ebook into (very) rough HTML, and then runs an external tool to turn the generated html into a .mobi Mobipocket ebook)
This works pretty well as a macro, but I want to run it from a batch file:
The problem I'm getting is that Uedit does not exit after running the macro, as directed by the E parameter, plus also it only works at all if Uedit is not already running in the background.
When I try to tackle the latter problem first with a custom .ini, containing a multipleinstances=1 line:
That seems to work, although it had me going for a little while as the Tool configuration is also in the ini and thus initially missing.
That did provide some useful diagnostics, though: With the tool definition gone, obviously it didn't make the mobi file (although, IMHO, tool-not-found should NOT fail silent, but whatever), but it *did* exit as it ought to. Can anyone figure out why it doesn't exit after calling the external tool? It's not just if it's in the last line, either, I just modified the macro to put a test string into the file after the mobigen line, and that works, but still results in not doing the Exit upon completion.
Code: Select all
InsertMode
ColumnModeOff
HexOff
UnixReOff
Find MatchCase PreserveCase "^p^p"
Replace All "<P>"
Find MatchCase PreserveCase "^p"
Replace All " "
"<BODY>
"
InsertMode
Clipboard 9
CopyFilePath
Top
Paste
Find Up Select "."
Delete
".html"
SelectToTop
Cut
SaveAs "^c"
ClearClipboard
Clipboard 0
RunTool "Mobigen"
This works pretty well as a macro, but I want to run it from a batch file:
Code: Select all
"c:\Program Files\UltraEdit\uedit32.exe" %1
/M,E="D:\eBooks\Gutenberg\mobigen\txt2html2mobi.MAC"
When I try to tackle the latter problem first with a custom .ini, containing a multipleinstances=1 line:
Code: Select all
"c:\Program Files\UltraEdit\uedit32.exe" %1
/i=D:\eBooks\Gutenberg\mobigen\UEini.ini
/M,E="D:\eBooks\Gutenberg\mobigen\txt2html2mobi.MAC"
That did provide some useful diagnostics, though: With the tool definition gone, obviously it didn't make the mobi file (although, IMHO, tool-not-found should NOT fail silent, but whatever), but it *did* exit as it ought to. Can anyone figure out why it doesn't exit after calling the external tool? It's not just if it's in the last line, either, I just modified the macro to put a test string into the file after the mobigen line, and that works, but still results in not doing the Exit upon completion.