Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-20-2014, 03:28 PM   #1
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
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.
Vortex is offline   Reply With Quote
Old 03-20-2014, 07:18 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by Vortex View Post
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.
Did your Batch use a 'Call' and pass the variable?
theducks is offline   Reply With Quote
Advert
Old 03-20-2014, 07:45 PM   #3
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
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"
Vortex is offline   Reply With Quote
Old 03-20-2014, 07:59 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by Vortex View Post
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"
Call is part of the batch system that allows calling another batch without closing the first.

File not found seems to be your problem. Are you passing the filename and extension correctly
theducks is offline   Reply With Quote
Old 03-21-2014, 05:41 AM   #5
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
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.
Vortex is offline   Reply With Quote
Advert
Old 03-26-2014, 05:41 AM   #6
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
I guess not
Vortex is offline   Reply With Quote
Old 03-26-2014, 07:37 AM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Vortex View Post
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.
Is the HTMLZ file in the book folder - to Open the folder press 'o' or click Open the folder in right panel (btw that panel is the Book Details panel)

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
BetterRed is offline   Reply With Quote
Old 03-26-2014, 02:46 PM   #8
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
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.
Vortex is offline   Reply With Quote
Old 03-26-2014, 04:43 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Vortex View Post
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.
@Vortex - OK - I'm going to have to go through this step by step, so I may ask for stuff you already posted - sorry but...

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:
does not work when you click the HTMLZ format link beneath "Authors" on the right side of Calibre
What do you mean by does not work - does it report an error or just do nothing

Quote:
It works perfect out of Calibre clicking on any .htmlz file in any folder.
This implies that you have set a Windows File Association for HTMLZ, presumably to your batch file - that's not something I've ever needed to do.

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
Attached Thumbnails
Click image for larger version

Name:	Capture1.JPG
Views:	192
Size:	62.2 KB
ID:	120845   Click image for larger version

Name:	Capture2.JPG
Views:	194
Size:	226.2 KB
ID:	120846  
BetterRed is offline   Reply With Quote
Old 03-26-2014, 05:57 PM   #10
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
BR, Thanks for taking the time to help

Quote:
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 ?
Yes settings unchecked.

Quote:
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.

What do you mean by does not work - does it report an error or just do nothing

This implies that you have set a Windows File Association for HTMLZ, presumably to your batch file - that's not something I've ever needed to do.
In Windows 7 "Control Panel\All Control Panel Items\Default Programs\Set Associations" I have .htmlz files set to open with my batch file (htmlz2zip.bat). It tries to execute the batch file but it fails with the error:

================================================
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.
Attached Thumbnails
Click image for larger version

Name:	htmlzfileass.jpg
Views:	192
Size:	75.2 KB
ID:	120848  
Vortex is offline   Reply With Quote
Old 03-26-2014, 06:48 PM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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
BetterRed is offline   Reply With Quote
Old 03-26-2014, 07:08 PM   #12
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
Quote:
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?
No it doesn't, I get the error:

================================================
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:
Attached Thumbnails
Click image for larger version

Name:	ftm.jpg
Views:	142
Size:	250.7 KB
ID:	120850  
Vortex is offline   Reply With Quote
Old 03-26-2014, 08:10 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Vortex View Post
No it doesn't, I get the error:
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.
BetterRed is offline   Reply With Quote
Old 03-26-2014, 08:51 PM   #14
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
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.
PeterT is offline   Reply With Quote
Old 03-27-2014, 07:57 AM   #15
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
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 . . .
============================================
Vortex is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 10:26 AM.


MobileRead.com is a privately owned, operated and funded community.