Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 08-10-2022, 03:11 AM   #391
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Version 1.7.2

Version 1.7.2
  • Update: update to calibre6 icon themes. Code borrowed from @JimmXinu.
capink is offline   Reply With Quote
Old 09-11-2022, 04:34 PM   #392
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 993
Karma: 6417070
Join Date: Sep 2020
Device: Calibre E-book viewer
Hi, thanks for the update.

I wanted to have Sumatra open any title by a single shortcut key on Calibre, but it seems the Open With plugin needs distinct shortcut keys for each format. I'm using Sumatra as default viewer just for CBZ and CBR formats.

Is there some hack I can apply to Calibre shortcut keys, or to the plugin itself, in order to have this secondary viewer open EPUB, MOBI, AZW3 by the same key? Some way to override program behaviour of not accepting assignment of the same shortcut key to different actions?
Comfy.n is offline   Reply With Quote
Advert
Old 09-11-2022, 07:55 PM   #393
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Use the Action Chains plugin. It has and open with action based on this plugin, but it supports template language which can do what you want.

Make a chain withe single action (Open with action), and configure the action by choosing the path to desired program. After that choose the template option and enter the following template:

Code:
program:
	priority = 'CBZ,CBR,EPUB,MOBI,AZW3';
	paths = formats_paths();
	for fmt in priority:
		path = select(paths, fmt);
		if path 
		then
			path;
			break
		fi
	rof
You can assign this chain to whatever keyboard shortcut you wish. It should open format based on your priority variable.

Notes:
  • Change the order of the formats in the variable highlighted in blue to the order as you wish.
  • The formats should be in UPPER LETTERS.
  • If you don't want the chain to be available for books without these formats, you can set a condition on the chain as follows:
    Code:
    template = copy the same template above
    datatype = text
    comparison = "!="
    condition value = Leave this empty
    Also, check the "disable menu chain if condition is false" check box.

Last edited by capink; 09-11-2022 at 08:06 PM.
capink is offline   Reply With Quote
Old 09-11-2022, 08:22 PM   #394
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 993
Karma: 6417070
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by capink View Post
Use the Action Chains plugin. It has and open with action based on this plugin, but it supports template language which can do what you want[...]
Thank you so much!

I'm not familiar with the Chains PI, but i think that will work
Comfy.n is offline   Reply With Quote
Old 09-11-2022, 08:55 PM   #395
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Well, Now that I think about it, I remember dadvifor (may his soul rest in peace) actually added template capability to this plugin. You should choose template option in the formats dropdown menu, and then enter the template from the post above into the args column in the open with plugin.

Last edited by capink; 09-11-2022 at 09:02 PM.
capink is offline   Reply With Quote
Advert
Old 09-11-2022, 09:17 PM   #396
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 993
Karma: 6417070
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by capink View Post
Use the Action Chains plugin. It has and open with action based on this plugin, but it supports template language which can do what you want.

Make a chain withe single action (Open with action), and configure the action by choosing the path to desired program. After that choose the template option and enter the following template:

Code:
program:
	priority = 'CBZ,CBR,EPUB,MOBI,AZW3';
	paths = formats_paths();
	for fmt in priority:
		path = select(paths, fmt);
		if path 
		then
			path;
			break
		fi
	rof
You can assign this chain to whatever keyboard shortcut you wish. It should open format based on your priority variable.

Notes:
  • Change the order of the formats in the variable highlighted in blue to the order as you wish.
  • The formats should be in UPPER LETTERS.
  • If you don't want the chain to be available for books without these formats, you can set a condition on the chain as follows:
    Code:
    template = copy the same template above
    datatype = text
    comparison = "!="
    condition value = Leave this empty
    Also, check the "disable menu chain if condition is false" check box.
Amazing! That worked!

I have just assigned 'M' as that Chain shortcut key (removed it from 'Merge')...

Then, searched for title:"art of" and (#filter:"=EPUB" or #filter:"=MOBI" or #filter:"=AZW3") , to have the formats I wanted show up for testing...

Then selected one book of each format, pressed 'M'...
and Sumatra opened them instantly !



I think I had installed your Actions Chain Plugin before, but I uninstalled it because I couldn't see any of those dropdown menus... So i thought it had been made strictly for coders (which somehow it is, as I wouldn't be able to generate that program you wrote..)

Now I realise that what was preventing me from figuring out how the PI works was that QT6 interface re-drawing thing, that happened after Calibre 6. Every dialog must be resized by the user, stretched... so one can see all the PI options and enjoy the plugin capabilities.

Last edited by Comfy.n; 09-12-2022 at 08:57 PM.
Comfy.n is offline   Reply With Quote
Old 09-11-2022, 09:28 PM   #397
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 993
Karma: 6417070
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by capink View Post
Well, Now that I think about it, I remember davidfor (may his soul rest in peace) actually added template capability to this plugin. You should choose template option in the formats dropdown menu, and then enter the template from the post above into the args column in the open with plugin.
I wish I could thank him, as well.

I'm posting some screenshots, in case someone wants to implement that Chain and see how it goes.
Attached Thumbnails
Click image for larger version

Name:	MWSnap0610 2022-09-11, 22_22_12.png
Views:	136
Size:	22.4 KB
ID:	196464   Click image for larger version

Name:	MWSnap0611 2022-09-11, 22_22_35.png
Views:	130
Size:	23.4 KB
ID:	196465   Click image for larger version

Name:	MWSnap0612 2022-09-11, 22_22_48.png
Views:	130
Size:	14.3 KB
ID:	196466   Click image for larger version

Name:	MWSnap0614 2022-09-11, 22_25_22.png
Views:	133
Size:	367.6 KB
ID:	196467  
Comfy.n is offline   Reply With Quote
Old 10-16-2022, 02:05 PM   #398
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Open With v1.8.0 Released

Release Notes:
https://github.com/kiwidude68/calibr...en_with-v1.8.0
kiwidude is offline   Reply With Quote
Old 12-24-2022, 01:12 AM   #399
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Open With v1.8.1 Released

Release Notes:
https://github.com/kiwidude68/calibr...en_with-v1.8.1

This adds a %FILENAME% token that can be used for applications that need more granular control over where the filename of the selected book/cover is inserted in the command line. It has always defaulted to being the last argument without using this token.

See the Help file for more info.
kiwidude is offline   Reply With Quote
Old 12-30-2022, 12:13 PM   #400
fantafrik
Member
fantafrik began at the beginning.
 
fantafrik's Avatar
 
Posts: 14
Karma: 10
Join Date: Sep 2008
Device: Sony PRS-505
I would like to know if is it possible to open two selected files as parameter with the "Open with" plugin. I want to open two pdf files with "diff-pdf-win" [https://vslavik.github.io/diff-pdf/] from calibre, i know how to pass parameters, but I do not know how to indicate it has two input files. Is it possible?
fantafrik is offline   Reply With Quote
Old 12-31-2022, 06:44 PM   #401
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by fantafrik View Post
I would like to know if is it possible to open two selected files as parameter with the "Open with" plugin. I want to open two pdf files with "diff-pdf-win" [https://vslavik.github.io/diff-pdf/] from calibre, i know how to pass parameters, but I do not know how to indicate it has two input files. Is it possible?
Not currently. It would require code changes to support an open with menu item entry that would pass all selected book rows to a single application rather than doing an individual launch of an app for each row.
kiwidude is offline   Reply With Quote
Old 01-03-2023, 08:00 AM   #402
fantafrik
Member
fantafrik began at the beginning.
 
fantafrik's Avatar
 
Posts: 14
Karma: 10
Join Date: Sep 2008
Device: Sony PRS-505
Quote:
Originally Posted by kiwidude View Post
Not currently. It would require code changes to support an open with menu item entry that would pass all selected book rows to a single application rather than doing an individual launch of an app for each row.
Thank you very much for the clarification. It could be a nice feature, I think a lot of people have many versions of the same book, the upper refered app could help to clean our libraries.
fantafrik is offline   Reply With Quote
Old 03-16-2024, 11:44 PM   #403
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Open With v1.8.2

Release Notes
https://github.com/kiwidude68/calibr...en_with-v1.8.2
kiwidude is offline   Reply With Quote
Old 04-01-2024, 08:39 AM   #404
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Open With v1.8.3

Release Notes
https://github.com/kiwidude68/calibr...en_with-v1.8.3

Fix for calibre 7.
kiwidude is offline   Reply With Quote
Reply

Tags
conversion, kepubify


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Search the Internet kiwidude Plugins 433 04-01-2024 05:48 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM
Gui confusements. brewt Calibre 8 12-30-2008 12:16 PM
Reference Open eBook Forum: Open eBook Publication Structure. IMP. V1.0.1 14 September 2007 DaleDe IMP Books 0 09-14-2007 05:06 PM
iLiad GUI for the iLiad tribble iRex Developer's Corner 1 06-01-2007 02:29 PM


All times are GMT -4. The time now is 01:20 AM.


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