![]() |
#1 |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Get the ubook reader program to read HTMLZ
Is it possible to use the Open With plugin to launch a batch file to process a book and then open it in a specific reader? I've been trying to set this up, the batch file works perfect outside of Calibre but when I try to use it via the Open With plugin the dos box just flashes and exits with nothing done.
|
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,944
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Sorry, I'm new to this so I dont know what that means. I 've added a 'Pause' to the end of the batch and I can now see the error: "File not found"
|
![]() |
![]() |
![]() |
#4 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,944
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
File not found seems to be your problem. Are you passing the filename and extension correctly |
|
![]() |
![]() |
![]() |
#5 |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Again I'm not sure what that means so I'd better explain exactly what I'm trying to do.
In the OS I have .htmlz files associated with the batch file so that when one is clicked the batch file creates a copy renamed to .zip and then opens that in my reader, (my reader does not recognize the htmlz file extension and the zip output is incompatible and in use by other programs.) The batch works perfect out of Calibre. I have the 'Open With' plugin installed and customized so htmlz should open with the batch. If I click the 'HTMLZ' extension link on the right side of Calibre it stops with the error "File not found". If I click on the 'Open With' icon on the top bar of Calibre and click on 'htmlz' the batch just flashes and exits. The code in the batch is: ::====== script starts here =============== :: @echo off & setLocal enableDELAYedeXpansioN :main for /f "tokens=* delims= " %%a in ('dir/b *.htmlz') do ( copy "%%a" "%%~Na.zip" "C:\Program Files (x86)\ubook\uBook.exe" "%%~Na.zip" ) Pause ::====== script ends here ================= With Echo on I get: ================================================ C:\Users\-\Desktop\books\Calibre Portable>for /F "tokens=* delims= " %a in ('dir /b *.htmlz') do ( copy "%a" "%~Na.zip" "C:\Program Files (x86)\ubook\uBook.exe" "%~Na.zip" ) File Not Found C:\Users\-\Desktop\books\Calibre Portable>Pause Press any key to continue . . . ============================================ When run outside of Calibre I get: ============================================ C:\Users\-\Desktop\books\Calibre Portable\Calibre Library\Caroline B. Cooney\Fre eze Tag (6)>for /F "tokens=* delims= " %a in ('dir/b *.htmlz') do ( copy "%a" "%~Na.zip" "C:\Program Files (x86)\ubook\uBook.exe" "%~Na.zip" ) C:\Users\-\Desktop\books\Calibre Portable\Calibre Library\Caroline B. Cooney\Fre eze Tag (6)>( copy "Freeze Tag - Caroline B. Cooney.htmlz" "Freeze Tag - Caroline B. Cooney.zi p" "C:\Program Files (x86)\ubook\uBook.exe" "Freeze Tag - Caroline B. Cooney.zip" ) 1 file(s) copied. ============================================ Looks like it's trying to copy and convert calibre instead of the book? Anyone help me out with this? ![]() Last edited by Vortex; 03-21-2014 at 06:15 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
I guess not
![]() |
![]() |
![]() |
![]() |
#7 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
If it isn't then that's the problem If it is then to where do you expect your batch file to copy the .HTMLZ and rename it to .ZIP ? If you run the batch file manually is the .ZIP in that place and is the HTMLZ still in the book folder ? BR |
|
![]() |
![]() |
![]() |
#8 |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Yes, the HTMLZ file is in the book folder.
The batch file copies and renames the file into the same folder as the HTMLZ file. Yes, if I run the batch manually the .ZIP is in place and the HTMLZ is still in the book folder. It works perfect out of Calibre (clicking on any .htmlz file in any folder), but does not work when you click the HTMLZ format link beneath "Authors" on the right side of Calibre , or when you click on the HTMLZ link under the Open With button. Last edited by Vortex; 03-26-2014 at 02:49 PM. |
![]() |
![]() |
![]() |
#9 | |||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
As far as I know the file type HTMLZ is peculiar to calibre see ==>> http://www.fileinfo.com/extension/htmlz The default handler within calibre itself for HTMLZ is the calibre ebook-viewer i.e. Preferences->Behaviour->Use internal viewer->HTMLZ is checked. Can you confirm that you have unchecked that setting ? Assuming you've done that, then when you click on the HTMLZ link in the Book Details panel calibre will ask Windows to open the file with whatever it has in its File Association table for HTMLZ. By default Windows wont have anything for HTMLZ so it will report an error to calibre, and calibre will display an error - see first attachment. So when you say Quote:
Quote:
I need to see the details of the file association, IMO Windows tools are inadequate for this, so could you download this program http://www.nirsoft.net/utils/file_types_manager.html. The download links are towards the bottom of the page. Nir Sofer's programs are 'as safe as houses', you don't have to install them just unzip to a folder and run the executable. The second attachment shows what I have associated for ZIP files (WinRAR), to get the Properties panel right click the HTLMZ line in the top panel and select Properties Take a screen shot and post here via Manage Attachments. I mainly use the Windows Snipper Tool - search for snipper in start menu, suggest you pin it to taskbar (IMO the handiest), or start menu or create a shortcut on desktop. BR |
|||
![]() |
![]() |
![]() |
#10 | ||
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
BR, Thanks for taking the time to help
Quote:
Quote:
================================================ C:\Users\-\Desktop\books\Calibre Portable>for /F "tokens=* delims= " %a in ('dir /b *.htmlz') do ( copy "%a" "%~Na.zip" "C:\Program Files (x86)\ubook\uBook.exe" "%~Na.zip" ) File Not Found C:\Users\-\Desktop\books\Calibre Portable>Pause Press any key to continue . . . ============================================ Screenshot from File Types Manager attached. |
||
![]() |
![]() |
![]() |
#11 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Vortex - Darn - I need to see what's in the lower pane of File Types Manager - especially the Command Line column - I have an inkling that's where the problem will be.
Another little test - put a shortcut to your batch file into your Send To folder, right click an HTMLZ and select Send To->your batch file - does it work? BR |
![]() |
![]() |
![]() |
#12 | |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Quote:
================================================ C:\>for /F "tokens=* delims= " %a in ('dir/b *.htmlz') do ( copy "%a" "%~Na.zip" "C:\Program Files\Program Files Portable\ubook\uBook.exe" "%~Na.zip" ) File Not Found C:\>Pause Press any key to continue . . . ================================================ File Types Manager attached again below: |
|
![]() |
![]() |
![]() |
#13 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
That's 'good' because now we have a situation where we get the same error via an out-of-the-box Windows feature. So if you can get a solution for Send To then you'll probably have a solution for Calibre.
Batch files can be obstreperous, maybe it would work if it was a Powershell, or VB script or something. But, I'm hopeless at figuring out scripting problems, if one doesn't work I write the equivalent in C. I'm not sure what to suggest - other than using something other than a .bat script. Hopefully someone will happen along and help you over the last hurdle. Or now that you've got it happening in Send To you could take the problem to a scripting forum - there used to be one at MS called Scripting Guys, but I'm not sure whether its still there - it was part of Technet. There is one guy here who could give you answer in a flash, but his handle escapes me. I'll PM you if I remember - I did remember his handle and I sent a you a PM Sorry I can't help any further. Maybe when you get an answer you'll make post here and tell what it was, in case someone else runs into a similar issue Good luck BR Last edited by BetterRed; 03-27-2014 at 01:01 AM. |
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,380
Karma: 78877538
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Why not change the copy command to prepend the word "echo " to it; this way we should see the command that is about to be executed.
|
![]() |
![]() |
![]() |
#15 |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
I'm not sure exactly what that means but if I add echo infront of the copy command I get:
================================================ C:\Program Files\Program Files Portable\Calibre Portable>for /F "tokens=* delims= " %a in ('dir/b *.htmlz') do ( echo copy "%a" "%~Na.zip" "C:\Program Files\Program Files Portable\ubook\uBook.exe" "%~Na.zip" ) File Not Found C:\Program Files\Program Files Portable\Calibre Portable>Pause Press any key to continue . . . ============================================ |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
MacBook can't read the Calibre program | tbhudson | Devices | 4 | 07-15-2013 12:44 AM |
read HTMLZ format Linux | BluePhoenix175 | Devices | 0 | 11-16-2012 11:46 PM |
NEW? Sony Reader Program - ????? | bookratt | Deals and Resources (No Self-Promotion or Affiliate Links) | 10 | 12-17-2009 08:53 AM |
Is there a program that can read your book file names and make a list? | GatorDeb | Reading and Management | 6 | 09-26-2008 12:57 PM |
ubook 0.9b e-book reader available | Colin Dunstan | Reading and Management | 5 | 12-28-2004 04:21 PM |