![]() |
#826 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I have no control over individual Calibre Actions.
|
![]() |
![]() |
![]() |
#827 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,004
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That's what I figured.
![]() |
![]() |
![]() |
![]() |
#828 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52
Karma: 52704
Join Date: Nov 2017
Device: none
|
Is there a way to paste information from the clipboard when using Single Field Edit? I want to count the number of books resulting from a particular search, then put that number into a field for a larger set of books (also determined by a search). I know I can use "ask at runtime" but would like to automate it if possible.
|
![]() |
![]() |
![]() |
#829 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I don't totally get what you want to do. but if you want to get the number of books resulting from search, you can utilize the from_search function in a template as follows:
Code:
program:
book_ids = from_search('id', 'enter_you_search_here');
number_of_books = count(book_ids, ',')
Code:
from calibre_plugins.action_chains.templates import TemplateFunction class CurrentSearch(TemplateFunction): name = 'current_search' arg_count = 0 def evaluate(self, formatter, kwargs, mi, locals): from calibre.gui2.ui import get_gui gui = get_gui() if gui: return gui.search.text() return _('This function can be used only in the GUI') Code:
program: search_string = current_search() |
![]() |
![]() |
![]() |
#830 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52
Karma: 52704
Join Date: Nov 2017
Device: none
|
Quote:
What I've got is: - clear marked books - mark books by the same author as the highlighted book - use selection modifier to show only marked books with a read-date - count the number of books shown as a result of the previous step - copy the result to the clipboard - show all the books by the same author again - single field edit to modify the custom column (which is where I'm using ask-at-runtime and pasting in the number from the clipboard) I'm not familiar with the language of templates (I mostly just steal stuff from this forum), but if it was possible to use something like "from_clipboard" in a template for single-field-edit, I think it would work. I'm open to other ways of getting this done though. |
|
![]() |
![]() |
![]() |
#831 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,004
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: Is there a way to prevent the book selection from accidentally changing partway through a chain?
I'm not sure what happened, a misclick perhaps or the list getting re-sorted by one of the actions, but the selection got changed partway through my 'mark as read' chain and some of the actions were applied to the wrong book. No real damage done in this case, but obviously don't want that occurring on more destructive chains (e.g. one that clears several fields). Last edited by ownedbycats; 02-15-2022 at 01:15 PM. |
![]() |
![]() |
![]() |
#832 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
The way this was supposed to be done is by making chains launch a progress dialog blocking calibre until the chains finishes. This was not possible to implement, because some "Calibre Actions" have their own progress dialogs (and other dialogs). That is why action chains progress bar appears in the status bar.
No other way I can think of to implement this. So, be careful not to misclick. Last edited by capink; 02-15-2022 at 02:11 PM. |
![]() |
![]() |
![]() |
#833 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,004
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Is there a way to validate all the chains at once without running them, or otherwise check for invalid Calibre actions? One of my plugins changed some strings so I'd like to check which chains need fixing.
Last edited by ownedbycats; 02-25-2022 at 11:09 PM. |
![]() |
![]() |
![]() |
#834 |
Connoisseur
![]() Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
|
Is it possible to make an action that would switch to a virtual library?
|
![]() |
![]() |
![]() |
#835 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,004
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
|
![]() |
![]() |
![]() |
#836 |
Connoisseur
![]() Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
|
|
![]() |
![]() |
![]() |
#837 |
Connoisseur
![]() Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
|
I've been using Action Chains a lot for the purpose of marking an action done in the metadata after doing it. But I can't achieve this with Modify EPUB, at least not with the accuracy I'd wish, because of the way that it works. The jobs run asynchronously, and you have to click on a prompt at the end in order to replace the EPUB file.
For most of my actions, I'm able to use the "modified by last action or during this chain" scope so that I know I actually did the action that I am checking off. But I can't do that with Modify EPUB, because the chain finishes running before I can accept the modified EPUBs, so they don't show as modified during the chain. I tried using a prompt, but the prompt blocks me from clicking on the button to accept the modified EPUBs, so it's no help. Does anyone have any ideas for me if there's a way to work around this? Maybe a timer before it checks to see if books are modified? That would only work if I'm paying enough attention to click the button before the timer expires. Assuming I am even understanding how the timer works. |
![]() |
![]() |
![]() |
#838 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@capink: could you take a look at the View Manager thread starting here? The discussion is about delays when clicking on VL tabs. Clicking on a tab triggers a chain that uses the View Manager. It seems to call save_state *many* times (see the log in this post).
I think it would be best if you reply on the view manager thread. |
![]() |
![]() |
![]() |
#839 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,744
Karma: 30237526
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
![]() |
#840 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,004
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: Is there an option to output the results of a template to a dialog box? A bit more convenient than running a saved template in the tester.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 PM |
Action Chains Resources | capink | Plugins | 77 | 06-16-2025 12:45 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |