06-06-2024, 12:17 PM | #1366 | |
Wizard
Posts: 1,139
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
Last edited by capink; 06-10-2024 at 09:20 AM. Reason: Remove zip attachment |
|
06-10-2024, 04:53 AM | #1367 |
Enthusiast
Posts: 29
Karma: 10
Join Date: Jul 2023
Device: KindleOasis10thGen
|
Thanks !
Yes indeed, that fixes it !
Many thanks, capink |
Advert | |
|
06-27-2024, 11:09 AM | #1368 |
Junior Member
Posts: 2
Karma: 10
Join Date: May 2024
Device: Kobo Clara Colour, Kindle Oasis
|
hey all, sorry for the silly question. I've tried searching here and reviewing the template page, but I'm still stuck.
All I'm trying to do is find any $title which contains a colon or a hyphen, and move the second half to a custom #subtitle field. Right now I have the find & replace working fine - the regex I use is two-stage (I don't know how to do it in one stage with the search and replace action) where I search for .+ ?[:-] (.+) and put the first match into the #subtitle field, then do a second search for (.+) ?[:-] .+ and replace the $title field with the first match, to remove the subtitle. I'm trying to move these two saved searches into an action chain, though, and therefore I'd like to be able to just run it on any selection in my library. With the way I have it configured, though, this causes issues on books which don't have a [:-] in the title, due to how search & replace seems to work (if no capture groups exist, \1 just matches the whole search, so the full title will be transferred into #subtitle). Anyway, what I'm trying to do now is to use a template scope to filter the action to only run on titles which contain [:-]. The problem I'm having is that I guess I'm just dumb and I can't figure out how exactly to just use a template to limit to a subset of my current scope. There's a contains(), but that seems to just give back text. I've tried downloading and reviewing a few chains posted here that have scopes, but it doesn't make much sense to me. I guess I haven't wrapped my brain around exactly how calibre templates work. I'm sure this can all be done in one step, the main thing I have difficulty understanding is how incoming and outgoing variables are handled, or basically the 'state' of everything that I'm acting on. Thanks for reading! Last edited by noahkiss; 06-27-2024 at 11:13 AM. Reason: trying to fix formatting |
06-27-2024, 03:19 PM | #1369 | |
Wizard
Posts: 1,139
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
Code:
title:~.+:.+ |
|
06-29-2024, 07:24 PM | #1370 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jun 2024
Device: Koba Aura
|
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) |
Advert | |
|
06-29-2024, 08:37 PM | #1371 | |
Wizard
Posts: 1,139
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
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)
|
|
06-30-2024, 04:20 PM | #1372 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Jun 2024
Device: Koba Aura
|
Quote:
|
|
07-26-2024, 07:34 AM | #1373 |
Custom User Title
Posts: 9,589
Karma: 65099765
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Was the option to set a predefined value to the current datetime removed for some reason? template with today() works but it's odd.
EDIT: Existing ones still work as expected. Last edited by ownedbycats; 07-26-2024 at 09:15 AM. |
07-26-2024, 03:56 PM | #1374 |
Wizard
Posts: 1,139
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
It is working for me in both existing and new ones. Is this happening only with date columns? Also maybe the widget is resizing properly, so make it bigger manually and see if the option were hidden.
|
07-26-2024, 07:37 PM | #1375 |
Custom User Title
Posts: 9,589
Karma: 65099765
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
It was a window size issue. The widget disappears if the window height too short.
|
07-27-2024, 07:41 PM | #1376 |
Custom User Title
Posts: 9,589
Karma: 65099765
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Is it possible to use chain-caller on a specific variant of a chain?
|
07-27-2024, 10:34 PM | #1377 | |
Wizard
Posts: 1,139
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
08-02-2024, 01:56 AM | #1378 | |
Custom User Title
Posts: 9,589
Karma: 65099765
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
My called chain has a variant called 'tbr' Code:
program: add_chain_variant('Add to Backlog','rg','', 'statistics.png'); add_chain_variant('Add to Backlog + TBR List','tbr','','statistics.png'); The two actions marked under 'tbr' didn't run, though. EDIT: I figured it out, I misunderstood the instructions. I was only supposed to put tbr (no quotes and not the full thing) into the template. Last edited by ownedbycats; 08-02-2024 at 02:03 AM. |
|
08-13-2024, 08:03 PM | #1379 |
Evangelist
Posts: 451
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Before I get too far into the documentation, is it possible to create a chain that:
1) Runs Sync Now from the Reading List plugin 2) Runs the SmartEject plugin |
08-13-2024, 08:39 PM | #1380 |
Custom User Title
Posts: 9,589
Karma: 65099765
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Probably not as expected. When I run "sync now" from an action chain it just silently fails half the time and I have to run it manually.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Action Chains Resources | capink | Plugins | 66 | 11-10-2024 08:13 PM |
[Editor Plugin] Editor Chains | capink | Plugins | 94 | 07-03-2024 08:26 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 04:15 PM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 06:25 AM |