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 02-10-2022, 08:27 AM   #826
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
I have no control over individual Calibre Actions.
capink is offline   Reply With Quote
Old 02-10-2022, 08:28 AM   #827
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,004
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That's what I figured. I'll see if I can figure out why it gets minimized. Maybe rearranging the order of chain actions might help.
ownedbycats is online now   Reply With Quote
Old 02-13-2022, 10:44 AM   #828
dewd
Connoisseur
dewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfolded
 
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.
dewd is offline   Reply With Quote
Old 02-13-2022, 12:09 PM   #829
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,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, ',')
If, for some reason, you want to get the search string from calibre's search box, you have to define a new custom template function, by copying the code below (Action Chains > Manage Modules > Create Module > copy/paste):

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')
Now, you can use the above template function to get the search string as follows:

Code:
program:
    search_string = current_search()
capink is offline   Reply With Quote
Old 02-13-2022, 01:51 PM   #830
dewd
Connoisseur
dewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfoldeddewd reads XML... blindfolded
 
Posts: 52
Karma: 52704
Join Date: Nov 2017
Device: none
Quote:
Originally Posted by capink View Post
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:
Sorry, I probably wasn't clear enough. I should have used the word "selection" rather than "search". My aim is to count the number of read books by the selected author, then put that number into a custom column for all of that author's books (both read and unread).

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.
dewd is offline   Reply With Quote
Old 02-15-2022, 01:11 PM   #831
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
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.
ownedbycats is online now   Reply With Quote
Old 02-15-2022, 01:36 PM   #832
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,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.
capink is offline   Reply With Quote
Old 02-25-2022, 11:07 PM   #833
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
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.
ownedbycats is online now   Reply With Quote
Old 03-06-2022, 06:41 PM   #834
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
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?
tamaracks is offline   Reply With Quote
Old 03-06-2022, 06:48 PM   #835
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,004
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by tamaracks View Post
Is it possible to make an action that would switch to a virtual library?
View Manager and a Calibre action to switch to a view assigned to the VL may work for your purposes.
ownedbycats is online now   Reply With Quote
Old 03-06-2022, 11:25 PM   #836
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
Quote:
Originally Posted by ownedbycats View Post
View Manager and a Calibre action to switch to a view assigned to the VL may work for your purposes.
Thanks! That did the trick.
tamaracks is offline   Reply With Quote
Old 03-06-2022, 11:33 PM   #837
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
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.
tamaracks is offline   Reply With Quote
Old 03-07-2022, 04:05 PM   #838
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
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.
chaley is offline   Reply With Quote
Old 03-07-2022, 05:21 PM   #839
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,744
Karma: 30237526
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
@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.
@capink - I moved the issue to Slow switching of Views - Long thread

BR
BetterRed is offline   Reply With Quote
Old 04-22-2022, 02:33 PM   #840
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
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.
ownedbycats is online now   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 05:44 PM.


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