View Single Post
Old 06-29-2024, 07:37 PM   #1371
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,203
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by tkshorty View Post
Hi all,

I am pretty sure that there is a really simple way to do this if you know Python and the calibre classes. Sadly I don't
So here is what I want to do:
1. display a message after a chain is completed and user has to press ok to close the message
2. display a message after a chain is completed and user has to press ok to close the message or message closes automatically after X seconds
3. query the user with a yes / no question and call a chain depending on answer (without using a new custom field to do that)
You can do no.1 and no.3 with this custom module. To add the module, go to Action Chains > Manage Modules > add > copy/paste. After which a new custom action called "Confirm" will be added, and can be used to splash a yes/no message with a customized message.

As for no.2 you simply add another "Run Python Code" action, with the following code:

Code:
import time

def run(gui, settings, chain):
    time.sleep(5)
Replace the digit in red with how many seconds you want.
capink is offline   Reply With Quote