![]() |
#796 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
globals(pagenum); Code:
pagenum = globals(pagenum); Code:
pagenum = globals(pagenum, foobar); |
|
![]() |
![]() |
![]() |
#797 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
OK, I think I understand what is happening to you now. Since you are still trying to configure an action without having run the chain, the value of pagenum is an empty string (chain variables are only assigned at runtime, even without the runtime option ticked).
So, at this point in time, the value of pagenum (empty string) cannot be used in mathematical operations, and the template evaluator will return an error and you will not be able to save it. To remedy this: Code:
program:
pagenum = ifempty(globals(pagenum), 1)
pagenum = globals(pagenum=1)
Last edited by capink; 01-14-2022 at 10:36 AM. Reason: include chaley's solution |
![]() |
![]() |
![]() |
#798 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
globals(pagenum=1) |
|
![]() |
![]() |
![]() |
#799 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
![]() Edit: Chain Variables documentation updated. Last edited by capink; 01-14-2022 at 01:01 PM. |
|
![]() |
![]() |
![]() |
#800 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That worked. Thank you
![]() |
![]() |
![]() |
![]() |
#801 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
quick question: Does the variable name need to be One_String_Without_Any_Spaces? I tried changing it to "Current Page" and couldn't get that into the template without an error. Current_Page works though.
|
![]() |
![]() |
![]() |
#802 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Spaces are not allowed in variable names.
|
![]() |
![]() |
![]() |
#803 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: How does Action Chains treat Calibre Action dialogs?
Does the chain wait until I press ok/cancel to close the dialog, or proceed running in the background? |
![]() |
![]() |
![]() |
#804 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
It depends on the dialog itself.
Last edited by capink; 01-24-2022 at 12:12 PM. |
![]() |
![]() |
![]() |
#805 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Is it possible to use a module to set a variable?
Context: Mostly as curiosity/to figure out how the code works, I wanted to see if I could make a modification of this chain that, instead of raise chain.UserInterrupt when clicking 'no,' instead sets a specified variable to a specified value on clicking 'yes'. That could then be used in a chain modifier to enable a specific action. ![]() Similar to the attached chain, but with a yes/no dialog in place of typing in 'yes' manually. Last edited by ownedbycats; 01-28-2022 at 07:25 AM. |
![]() |
![]() |
![]() |
#806 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Code:
chain.set_chain_vars({'my_var_name': 'false'}) |
|
![]() |
![]() |
![]() |
#807 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
It works.
![]() Just for confirming something I noticed: Are variable values case-sensitive? Last edited by ownedbycats; 01-29-2022 at 09:45 PM. |
![]() |
![]() |
![]() |
#808 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Also, silly question: Where exactly in single-field edit is the "add format from predefined path"? I only see the option to remove formats.
Last edited by ownedbycats; 01-30-2022 at 03:49 AM. |
![]() |
![]() |
![]() |
#809 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
|
![]() |
![]() |
![]() |
#810 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Last edited by capink; 01-30-2022 at 08:55 AM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Action Chains Resources | capink | Plugins | 78 | 08-05-2025 04:01 AM |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 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 |