View Single Post
Old 08-24-2024, 01:26 AM   #1393
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
The custom action below would store clipboard contents into a chain variable called clipboard:

Code:
from qt.core import QApplication
from calibre_plugins.action_chains.actions.base import ChainAction

class PasteClipboardAction(ChainAction):

    name = 'Paste Clipboard'

    def run(self, gui, settings, chain):
        chain.set_chain_vars({'clipboard': QApplication.clipboard().text()})
You can access that using the following template

Code:
program:
    globals(clipboard)
capink is offline   Reply With Quote