![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
Pass a parameter to external viewer using a custom column vaue
Hi,
I've added a custom column in the calibre database which contains the last read page for each book. I would like to use that value with the -p parameter of okular so that to open the file at the last read page. Is it possible? |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Yes, there are currently two plugins that can do this (both has a template option that can read values from custom columns):
Edit: Currently it is not possible to pass an argument value from a template, only the book format. So this probably not going to work of you. Last edited by capink; 04-21-2021 at 06:51 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
There is a workaround to this in the Action Chains plugin. The chain to run you program is attached to this post. (Action chains > add/modify chains > import).
You will need to edit the template in the first action (Copy To Clipboard) to replace the "#my_int_col" with your custom column name. The attached chain constructs a temporary shell script containing the appropriate command, and then runs it. Next version of the plugin will allow using template for command arguments. |
![]() |
![]() |
![]() |
#4 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
Quote:
I've a huge library and the value is populated only for files which I've read or I'm reading currently. EDIT: I've seen it is not possible and so I've changed the "#my_int_col" with ifempty($#last_read_page, 1) Is it correct? The issue is that I do not seen any additional button or contextual menu entry and it seems to ignore the plugin and keep calling okular directly. Maybe I've done something wrong? Last edited by Xwang; 04-22-2021 at 06:51 AM. |
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
It should be possible. But it is better to add a third action to open the file with okular without specifying the page number. You will also need to add conditions to each action specifying when to run. The first and second actions will only run if the custom column has a value. The third action will run if does not have a value.
Attached is modified version of the chain with the above conditions set. Note that you still have to replace all instances of #my_int_col with your custom column, including in the condition templates for all three actions. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
It is the same menu entry called "Open with Okular" under "Action Chains". There is no additional buttons or menu entries. You have to remove the old chain to be able to import the new one because they have the same name.
|
![]() |
![]() |
![]() |
#9 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
Quote:
I've installed the plugin action chains this morning and configured the command wth the ifempty. So I've not installed the second zip you send me, because it seems that it should work. However it is not working (the -p parameter is not present in the called process and to be sure I've made a test changing the okular command name in the plugin with blablabla which does not exists and when I double click the book in calibre it keeps opening the file with okular) and I am not understanding why. |
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
If it is not working for whatever reason, use the second zip I attached. You have to remove the old entry first before you import the second one because they have the same name.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using RE to extract pattern from custom column into another custom column | activedirectory | Library Management | 1 | 12-15-2019 08:07 PM |
Adding custom column with any lookup-name gives me empty column as a result? | Ahu Lee | Library Management | 16 | 06-09-2019 12:14 PM |
Browser Viewer: Long-text Custom Column | nqk | Server | 8 | 08-05-2018 08:25 AM |
Move selected data from series column to a new custom column | fvdham | Library Management | 3 | 06-02-2017 03:49 PM |
Custom column returns value based on value of another custom column? | calvin-c | Calibre | 3 | 09-14-2013 02:24 PM |