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)