Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 01-04-2022, 04:06 PM   #781
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,091
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by compurandom View Post
I'm looking for a more selective selection.
Something like given this search and sort, select variations of:
  • The first 10 items
  • The 10 items after an offset
  • a random 10 items
  • everything except the first 10 items
You can write a custom action that does what you want. To select books based on book_ids you can use:

Code:
books_ids = [1,2,3]
gui.library_view.select_rows(book_ids)
To get the currently selected books ids:

Code:
rows = gui.current_view().selectionModel().selectedRows()
book_ids = [ gui.library_view.model().db.id(row.row()) for row in rows ]
To get the book_ids for the first 10 books in the current library view:
Code:
book_ids = [gui.library_view.model().id(x) for x in range(0, 10)]

Last edited by capink; 01-06-2022 at 05:42 PM.
capink is offline   Reply With Quote
Old 01-04-2022, 04:10 PM   #782
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,091
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by MikePatch View Post
This plugin is a masterpiece!

Is it possible to use in action the bulk function to "Swap title and author"?
(I didn't find a way!)

Thx
Mike
You can use the custom module posted here.
capink is offline   Reply With Quote
Old 01-04-2022, 04:58 PM   #783
MikePatch
Member
MikePatch began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2021
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
You can use the custom module posted here.
Thank you!!!
Mike
MikePatch is offline   Reply With Quote
Old 01-06-2022, 05:35 PM   #784
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,091
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Version 1.16.0

Changes for the upcoming PyQt6.

Last edited by capink; 01-06-2022 at 05:42 PM.
capink is offline   Reply With Quote
Old 01-09-2022, 05:12 PM   #785
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: Is it expected for there to be a 1-2 second delay upon clicking the Action Chains menu? I've noticed it more since recently switching to running from source.

I have a few checking the device status and one with a variation.

Code:
{
  "ActionsChainMenus": {
    "Menus": [
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Open With",
              "action_settings": {
                "allow_multiple": true,
                "args": "-f \"*.azw3;*.epub;*.mobi;*.pdf\" -d",
                "path_opt": "folder",
                "path_sep": ";",
                "path_to_binary": "C:\\Program Files\\Mythicsoft\\Agent Ransack\\AgentRansack.exe",
                "use_default_app": false
              },
              "comment": ""
            }
          ],
          "refresh_gui": true
        },
        "image": "ransack.png",
        "menuText": "Search with Agent Ransack",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Copy To Clipboard",
              "action_settings": {
                "allow_multiple": true,
                "template": "program: containing_folder()"
              }
            }
          ],
          "refresh_gui": true
        },
        "image": "clipboard.png",
        "menuText": "Copy Path to Clipboard",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#lastread",
                "template": "program:\n\t\n\tif \n\t\tcheck_yes_no('#onkobo', 1, 0, 0)\n\t\tthen format_date(today(),'iso')\nelse $$#lastread\nfi",
                "value_type": "template"
              },
              "comment": "Set #lastread (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "value": 100,
                "value_type": "predefined"
              },
              "comment": "Set #percentread to 100",
              "start_time": {
                "__class__": "datetime.datetime",
                "__value__": "2020-11-27T20:16:25.403862+00:00"
              }
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobobookmark",
                "value_type": "clear"
              },
              "comment": "Clear #kobobookmark"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#ratings",
                "value_type": "prompt"
              },
              "comment": "Set rating",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "",
                "template": "program: selection_count()",
                "tooltip": "",
                "value": "1"
              },
              "start_time": {
                "__class__": "datetime.datetime",
                "__value__": "2020-11-27T20:16:25.528879+00:00"
              }
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Remove from list: To Be Read",
                    "path": [
                      "Reading List",
                      "Remove from list",
                      "Remove from list: To Be Read"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Remove from TBR list"
            },
            {
              "action_name": "Refresh View",
              "action_settings": {},
              "comment": "Refresh book list"
            }
          ],
          "refresh_gui": true
        },
        "image": "Bookmark.png",
        "menuText": "Mark as Read",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "value": 0,
                "value_type": "predefined"
              },
              "comment": "Set #percentread to 0"
            }
          ],
          "refresh_gui": true
        },
        "image": "Bookmark.png",
        "menuText": "Mark as Unread",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "value": 100,
                "value_type": "predefined"
              },
              "comment": "Set #percentread to 100"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "rating",
                "value_type": "prompt"
              },
              "comment": "Set rating"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Remove from list: To Be Read",
                    "path": [
                      "Reading List",
                      "Remove from list",
                      "Remove from list: To Be Read"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Remove from To Be Read list"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Add to list: Remove from Device",
                    "path": [
                      "Reading List",
                      "Add to list",
                      "Add to list: Remove from Device"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Add to Remove from Device list"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#onkobo",
                "value_type": "clear"
              },
              "comment": "Clear #onkobo value"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobobookmark",
                "value_type": "clear"
              },
              "comment": "Clear #kobobookmark value"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobopath",
                "value_type": "clear"
              },
              "comment": "Clear #kobopath value"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobocoll",
                "value_type": "clear"
              },
              "comment": "Clear Kobo collections"
            }
          ],
          "refresh_gui": true
        },
        "image": "library.png",
        "menuText": "Return Library Book",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Open Tag Manager",
              "action_settings": {
                "col_name": "tags"
              },
              "comment": "Open tags manager"
            }
          ],
          "refresh_gui": true
        },
        "condition_settings": {
          "affect_menu": true,
          "cmp_type": "=",
          "datatype": "number",
          "icon": "",
          "template": "program: selection_count()",
          "tooltip": "",
          "value": 1.0
        },
        "image": "tags.png",
        "menuText": "Quick Open Tags Manager",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "tags",
                "value": [
                  false,
                  "",
                  "@cleanup, "
                ],
                "value_type": "predefined"
              },
              "comment": "Remove @cleanup tag"
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: Remove @cleanup",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Extract ISBN",
                    "path": [
                      "Extract ISBN"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Extract ISBN"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Estimate page/word counts",
                    "path": [
                      "Count Pages",
                      "Estimate page/word counts"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Count pages"
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: ISBN + Pagecount",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Generate Cover",
                    "path": [
                      "Generate Cover"
                    ],
                    "paths_text": ""
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Open Generate Covers dialog"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Polish books",
                    "path": [
                      "Polish Books"
                    ],
                    "paths_text": ""
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Open Polish ePub dialog"
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: Generate Cover",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "identifiers",
                "template": "program:\n\tpublisher = $publisher;\n\tids = $identifiers;\n\tstatus = $#fanficstatus;\n\tu = select(ids, 'url');\n\n\tif publisher == 'Archive of Our Own' && u && status != 'Anthology' then\n\t\tn = re(u, '^https://archiveofourown.org/works/(\\d+)$', '\\1');\n\t\tids = list_union(ids, strcat('ao3:', n), ',')\n\tfi;\n\tids",
                "value_type": "template"
              },
              "comment": "Convert AO3 identifiers (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "identifiers",
                "template": "program:\n\tpublisher = $publisher;\n\tids = $identifiers;\n\tstatus = $#fanficstatus;\n\tu = select(ids, 'url');\n\n\tif publisher == 'FanFiction.net' && u && status != 'Anthology' then\n\t\tn = re(u, '^https://www.fanfiction.net/s/(\\d+)/(\\d+)/.*', '\\1');\n\t\tids = list_union(ids, strcat('ffnet:', n), ',')\n\tfi;\n\tids",
                "value_type": "template"
              },
              "comment": "Convert FFNet identifiers (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "identifiers",
                "template": "program:\n\tpublisher = $publisher;\n\tids = $identifiers;\n\tu = select(ids, 'uri');\n\tg = select(ids, 'gutenberg');\n\n\tif publisher == 'Project Gutenberg' && u != g then\n\t\tn = re(u, '^http://www.gutenberg.org/(\\d+)', '\\1');\n\t\tids = list_union(ids, strcat('gutenberg:', n), ',')\n\tfi;\n\n\tif publisher == 'Project Gutenberg' && u && g then\n\t\tids = list_difference(ids, strcat('uri:', u), ',')\n\tfi;\n\tids",
                "value_type": "template"
              },
              "comment": "Convert Project Gutenberg identifiers (TEMPLATE)"
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: Convert identifiers",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobocoll",
                "template": "program: \n\tcolumnupdate_kobocoll()",
                "value_type": "template"
              },
              "comment": "Update #kobocoll (TEMPLATE)"
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: Update Kobo Collections",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobopath",
                "template": "program:\n\tcolumnupdate_kobopath()",
                "value_type": "template"
              },
              "comment": ""
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: Update Kobo Path",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobobookmark",
                "template": "program:\n\tcolumnupdate_bookmarkincrement()",
                "value_type": "template"
              },
              "comment": "Increment bookmark by one (TEMPLATE)"
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: Increment fanfic bookmark",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobobookmark",
                "value_type": "clear"
              },
              "comment": "Clear bookmark"
            }
          ],
          "refresh_gui": true
        },
        "image": "cleanup.png",
        "menuText": "Cleanup: Clear Kobo bookmarks",
        "subMenu": "Cleanup Tasks"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Clean the selecteds Comments",
                    "path": [
                      "Comments Cleaner",
                      "Clean the selecteds Comments"
                    ]
                  }
                ]
              },
              "comment": "Clean comments"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#fanficstatus",
                "template": "program:\nd1 = format_date(today(),'iso');\nd2 = $$#fanficupdated;\nstatus = $#fanficstatus;\n\n\tif\n\t\tand(\n\t\t\tstatus=='In-Progress',\n\t\t\tdays_between(d1, d2) ># 365,\n\t\t\t)\n\tthen\n\t\t\"Abandoned\"\n\t\telif\n\t\t\tand(\n\t\t\t\tstatus=='In-Progress',\n\t\t\t\t$#fanficerror,\n\t\t\t\t)\n\t\tthen\n\t\t\t\"Abandoned\"\n\n\telse\n\t\tstatus\n\tfi",
                "value_type": "template"
              },
              "comment": "Set old/errored fics as abandoned (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "identifiers",
                "template": "program:\n\tpublisher = $publisher;\n\tids = $identifiers;\n\tstatus = $#fanficstatus;\n\tu = select(ids, 'url');\n\n\tif publisher == 'Archive of Our Own' && u && status != 'Anthology' then\n\t\tn = re(u, '^https://archiveofourown.org/works/(\\d+)$', '\\1');\n\t\tids = list_union(ids, strcat('ao3:', n), ',')\n\tfi;\n\tids",
                "value_type": "template"
              },
              "comment": "Convert url: identifiers to ao3: (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "identifiers",
                "template": "program:\n\tpublisher = $publisher;\n\tids = $identifiers;\n\tstatus = $#fanficstatus;\n\tu = select(ids, 'url');\n\n\tif publisher == 'FanFiction.net' && u && status != 'Anthology' then\n\t\tn = re(u, '^https://www.fanfiction.net/s/(\\d+)/(\\d+)/.*', '\\1');\n\t\tids = list_union(ids, strcat('ffnet:', n), ',')\n\tfi;\n\tids",
                "value_type": "template"
              },
              "comment": "Convert url: identifiers to ffnet: (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "identifiers",
                "template": "program:\n\tpublisher = $publisher;\n\tids = $identifiers;\n\tstatus = $#fanficstatus;\n\tu = select(ids, 'url');\n\n\tif 'Completed|Oneshot|Abandoned' in status && u &&\n\t\t\t(select(ids, 'ao3') || select(ids, 'ffnet')) then\n\t\tids = list_difference(ids, strcat('url:', u), ',')\n\tfi;\n\tids",
                "value_type": "template"
              },
              "comment": "Remove url: identifiers for Completed/Oneshots (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "tags",
                "template": "program:\n\tstatus = $#fanficstatus;\n\tt = $tags;\n\t\n\tif \n\t\tstatus == 'Anthology'\n\tthen\n\t\tt = list_difference(t, 'In-Progress,Complete', ',')\t\t\n\telse\n\t\tt\n\tfi",
                "value_type": "template"
              },
              "comment": "Anthology: Remove incorrect status tags (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#fanficcat",
                "template": "program:\n\tf =\tlist_sort($#fanficcat,0,',');\n\n\tif \n\t\tcontains(\n\t\t\tf, '^Crossover, Mass Effect Trilogy, Mass Effect: Andromeda$', '1', ''\n\t\t)\n\tthen \n\t\t'Mass Effect Trilogy, Mass Effect: Andromeda' \n\telif\n\t\tcontains(\n\t\t\tf, '^Crossover, Half-Life, Portal$', '1', ''\n\t\t)\t\n\t\tthen 'Half-Life, Portal' \n\telse\n\t\t$#fanficcat\n\tfi",
                "value_type": "template"
              },
              "comment": "Fix #fanficcat incorrectly marked Crossover (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "tags",
                "template": "program:\n\tf =\tlist_sort($#fanficcat,0,',');\n\n\tif \n\t\tcontains(\n\t\t\tf, '^Mass Effect Trilogy, Mass Effect: Andromeda$', '1', ''\n\t\t)\n\tthen \n\t\t'Fanfiction.Mass Effect' \n\n\telif\n\t\tcontains(\n\t\t\tf, '^Half-Life, Portal$', '1', ''\n\t\t)\t\n\t\tthen 'Fanfiction.Half-Life & Portal' \n\n\telse\n\t\t$tags\n\n\tfi",
                "value_type": "template"
              },
              "comment": "Fix tags incorrectly marked crossover (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "tags",
                "value": [
                  false,
                  "",
                  "@cleanup, "
                ],
                "value_type": "predefined"
              },
              "comment": "Remove @cleanup tag"
            }
          ],
          "refresh_gui": true
        },
        "image": "store.png",
        "menuText": "Cleanup: Fanfiction",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "value": 0,
                "value_type": "predefined"
              },
              "comment": "Set #percentread to 0"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Clean the selecteds Comments",
                    "path": [
                      "Comments Cleaner",
                      "Clean the selecteds Comments"
                    ],
                    "paths_text": "Clean the selecteds Comments"
                  }
                ]
              },
              "comment": "Run Comments Cleaner"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Extract ISBN",
                    "path": [
                      "Extract ISBN"
                    ],
                    "paths_text": ""
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Extract ISBN"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Estimate page/word counts",
                    "path": [
                      "Count Pages",
                      "Estimate page/word counts"
                    ],
                    "paths_text": "Estimate page/word counts"
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Count pages"
            }
          ],
          "refresh_gui": true
        },
        "image": "store.png",
        "menuText": "Cleanup: Fiction",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#onkobo",
                "value": true,
                "value_type": "predefined"
              },
              "comment": "Set #onkobo to Yes"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobocoll",
                "value": [
                  false,
                  "[Kobo Store], ",
                  ""
                ],
                "value_type": "predefined"
              },
              "comment": "Add [Kobo Store] to #kobocoll"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobocoll",
                "template": "program: \n\tcolumnupdate_kobocoll()",
                "value_type": "template"
              },
              "comment": "Update #kobocoll based on genres (TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobopath",
                "template": "program:\n\n\tif\n\t\t$#kobopath == ''\n\tthen\n\t\tcolumnupdate_kobopath()\n\telse\n\t\t$#kobopath fi",
                "value_type": "template"
              },
              "comment": "Generate #kobopath (TEMPLATE)"
            }
          ],
          "refresh_gui": true
        },
        "image": "store.png",
        "menuText": "Cleanup: Kobo",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#onkobo",
                "value": true,
                "value_type": "predefined"
              },
              "comment": "Set #onkobo to yes"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobocoll",
                "value": [
                  false,
                  "Loans, ",
                  ""
                ],
                "value_type": "predefined"
              },
              "comment": "Add Loans to #kobocoll"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobopath",
                "value": "Loans",
                "value_type": "predefined"
              },
              "comment": "Add Loans to #kobopath"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "value": 0,
                "value_type": "predefined"
              },
              "comment": "Set #percentread to 100"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Add files to selected book records",
                    "path": [
                      "Add Books",
                      "Add files to selected book records"
                    ],
                    "paths_text": "Add files to selected book records"
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Add OVERDRIVE file"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Estimate page/word counts",
                    "path": [
                      "Count Pages",
                      "Estimate page/word counts"
                    ],
                    "paths_text": "Estimate page/word counts"
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Count pages"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Extract ISBN",
                    "path": [
                      "Extract ISBN"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Extract ISBN"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Search for selected books",
                    "path": [
                      "Overdrive Link",
                      "Search for selected books"
                    ]
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Get Overdrive links"
            }
          ],
          "refresh_gui": true
        },
        "image": "store.png",
        "menuText": "Cleanup: Loans",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobopath",
                "template": "program:\n\n\tif\n\t\t$#kobopath == ''\n\tthen\n\t\tcolumnupdate_kobopath()\n\telse\n\t\t$#kobopath fi",
                "value_type": "template"
              },
              "comment": "Generate #kobopath column (STORED TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobocoll",
                "template": "program: \n\tcolumnupdate_kobocoll()",
                "value_type": "template"
              },
              "comment": "Update #kobocoll column (STORED TEMPLATE)"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "template": "program:\nf = re($#chapters, '(.*)/.*', '\\1');\ns = re($#chapters, '.*/(.*)', '\\1');\n\n\tif \n\t\t$#chapters != 'Not Set'\n\t\t\tthen \n\t\t\t\tif and(\n\t\t\t\t\t\t$$#fanficcat,\n\t\t\t\t\t\tcheck_yes_no('#onkobo', 0, 1, 1),\n\t\t\t\t\t\t$$#percentread ==#100,\n\t\t\t\t\t\t(s - f) ==# 1\n\t\t\t\t\t\t) \n\t\t\t\tthen '98' \n\t\t\t\telse $$#percentread\n\t\t\tfi\n\n\t\telse $$#percentread\n\tfi",
                "value_type": "template"
              },
              "comment": "Update #percentread for fanfics (TEMPLATE)"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Add to list: To Be Read",
                    "path": [
                      "Reading List",
                      "Add to list",
                      "Add to list: To Be Read"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Add to TBR list (VARIABLE)",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "template_funcs.png",
                "template": "program: globals(_variant_argument)",
                "tooltip": "",
                "value": "add_yes"
              }
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Send to device",
                    "path": [
                      "Send To Device"
                    ],
                    "paths_text": ""
                  }
                ]
              },
              "comment": "Send to device if device is connected",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "reader.png",
                "template": "program: connected_device_name('main')",
                "tooltip": "Kobo Libra H2O connected",
                "value": "Kobo Libra H2O"
              }
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Add to list: Send to Device",
                    "path": [
                      "Reading List",
                      "Add to list",
                      "Add to list: Send to Device"
                    ],
                    "paths_text": "Add to list|Add to list: Send to Device"
                  }
                ]
              },
              "comment": "Add to \"Send to Device\" list if device is not connected",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "reader.png",
                "template": "program: connected_device_name('main')",
                "tooltip": "No device connected",
                "value": ""
              }
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#onkobo",
                "template": "program:\n\n\tif \n\t\t$#fanficcat \n\t&& \n\t\tcheck_yes_no('#onkobo', 0, 1, 1) \n\tthen \n\t\t'No' \n\n\telif \n\t\t$$#percentread != '0' \n\tthen \n\t\t'No' \n\telse \n\t\t'Yes'\n\tfi",
                "value_type": "template"
              },
              "comment": "Set #onkobo column (TEMPLATE)"
            },
            {
              "action_name": "Refresh Current Search",
              "action_settings": {},
              "comment": "Refresh current search"
            }
          ],
          "refresh_gui": true
        },
        "image": "sync.png",
        "menuText": "Send to Device",
        "subMenu": "",
        "variation_settings": {
          "template": "program:\n    add_chain_variant('Send to Device','add_no', '', 'sync.png');\n    add_chain_variant('Send to Device + Add to TBR List','add_yes', '', 'sync.png');"
        }
      },
      {
        "active": true,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Store/Restore current bookmark",
                    "path": [
                      "KoboUtilities",
                      "Store/Restore current bookmark"
                    ],
                    "paths_text": "Store/Restore current bookmark"
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Restore bookmarks"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Upload covers for Selected Books",
                    "path": [
                      "KoboUtilities",
                      "Upload covers for Selected Books"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Upload cover"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#onkobo",
                "value": true,
                "value_type": "predefined"
              },
              "comment": "Set #onkobo to yes"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Update cached metadata on device",
                    "path": [
                      "Location Manager",
                      "Device",
                      "Update cached metadata on device"
                    ],
                    "paths_text": "Device|Update cached metadata on device"
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Update cached metadata",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "reader.png",
                "template": "",
                "tooltip": "",
                "value": ""
              }
            }
          ],
          "refresh_gui": true
        },
        "condition_settings": {
          "affect_menu": true,
          "cmp_type": "=",
          "datatype": "text",
          "icon": "reader.png",
          "template": "program: connected_device_name('main')",
          "tooltip": "Kobo Libra H2O connected",
          "value": "Kobo Libra H2O"
        },
        "image": "sync.png",
        "menuText": "Restore Bookmarks on Device",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Update ToC for Selected Books",
                    "path": [
                      "KoboUtilities",
                      "Update ToC for Selected Books"
                    ],
                    "paths_text": "Update ToC for Selected Books"
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Update TOC",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "template_funcs.png",
                "template": "",
                "tooltip": "",
                "value": "updatefanfic"
              }
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Store/Restore current bookmark",
                    "path": [
                      "KoboUtilities",
                      "Store/Restore current bookmark"
                    ],
                    "paths_text": "Store/Restore current bookmark"
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Restore bookmarks"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#onkobo",
                "value": true,
                "value_type": "predefined"
              },
              "comment": "Set #onkobo to yes"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": true,
                "selection": [
                  {
                    "display": "Update cached metadata on device",
                    "path": [
                      "Location Manager",
                      "Device",
                      "Update cached metadata on device"
                    ],
                    "paths_text": "Device|Update cached metadata on device"
                  }
                ],
                "wait_jobs": true,
                "wait_progress": true
              },
              "comment": "Update cached metadata",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "reader.png",
                "template": "",
                "tooltip": "",
                "value": ""
              }
            }
          ],
          "refresh_gui": true
        },
        "condition_settings": {
          "affect_menu": true,
          "cmp_type": "=",
          "datatype": "text",
          "icon": "reader.png",
          "template": "program: connected_device_name('main')",
          "tooltip": "Kobo Libra H2O connected",
          "value": "Kobo Libra H2O"
        },
        "image": "sync.png",
        "menuText": "Update Fanfic on Device",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Remove from list: To Be Read",
                    "path": [
                      "Reading List",
                      "Remove from list",
                      "Remove from list: To Be Read"
                    ],
                    "paths_text": "Remove from list|Remove from list: To Be Read"
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Remove from TBR list"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "value": 100,
                "value_type": "predefined"
              },
              "comment": "Set #percentread to 100"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobobookmark",
                "template": "program:\n\tinput = field('#kobobookmark');\n\tstatus = $#fanficstatus;\n\n\tif \n\t\tstatus == 'In-Progress' \n\tthen\n\t\tcolumnupdate_bookmarkincrement()\n\telse \n\t\tinput\n\tfi",
                "value_type": "template"
              },
              "comment": "Increment bookmark by one (TEMPLATE)"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Store/Restore current bookmark",
                    "path": [
                      "KoboUtilities",
                      "Store/Restore current bookmark"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Restore bookmarks to Kobo"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Update cached metadata on device",
                    "path": [
                      "Location Manager",
                      "Device",
                      "Update cached metadata on device"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Update cached metadata"
            }
          ],
          "refresh_gui": true
        },
        "condition_settings": {
          "affect_menu": true,
          "cmp_type": "=",
          "datatype": "text",
          "icon": "reader.png",
          "template": "program: connected_device_name('main')",
          "tooltip": "Kobo Libra H2O connected",
          "value": "Kobo Libra H2O"
        },
        "image": "sync.png",
        "menuText": "Mark Fanfic as Read on Device",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Confirm",
              "action_settings": {
                "message": "Are you sure you want to proceed?"
              },
              "comment": "Confirmation"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Remove from list: To Be Read",
                    "path": [
                      "Reading List",
                      "Remove from list",
                      "Remove from list: To Be Read"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Remove from To Be Read list"
            },
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "Add to list: Remove from Device",
                    "path": [
                      "Reading List",
                      "Add to list",
                      "Add to list: Remove from Device"
                    ]
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Add to Remove from Device list"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#onkobo",
                "value_type": "clear"
              },
              "comment": "Clear #onkobo value"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobobookmark",
                "value_type": "clear"
              },
              "comment": "Clear #kobobookmark value"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobopath",
                "value_type": "clear"
              },
              "comment": "Clear #kobopath value"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#kobocoll",
                "value_type": "clear"
              },
              "comment": "Clear Kobo collections"
            }
          ],
          "refresh_gui": true
        },
        "image": "remove_books.png",
        "menuText": "Remove from Device",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": ""
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "View",
                    "path": [
                      "View",
                      "View"
                    ],
                    "paths_text": "View"
                  }
                ],
                "wait_jobs": false,
                "wait_progress": false
              },
              "comment": "Open book",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "text",
                "icon": "",
                "template": "program:\n$formats != 'PAPERBOOK' && $formats != 'OVERDRIVE' && current_virtual_library_name() != 'Physical Books' && virtual_libraries() !='Loans'",
                "tooltip": "",
                "value": "1"
              }
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#percentread",
                "template": "program:\n\tif $$#percentread ==# '0' && $$#percentread !='None' then '1'\n\telse $$#percentread\n\tfi",
                "value_type": "template"
              },
              "comment": "Set #percentread to 1"
            },
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "#lastread",
                "template": "program:\n\tif $$#percentread != '100' && $$#percentread !='None' then today()\n\telse $$#lastread\n\tfi",
                "value_type": "template"
              },
              "comment": "Set #lastread to current time"
            },
            {
              "action_name": "Refresh View",
              "action_settings": {},
              "comment": "Refresh view"
            }
          ],
          "refresh_gui": true
        },
        "condition_settings": {
          "affect_menu": false,
          "cmp_type": "=",
          "datatype": "number",
          "icon": "",
          "template": "program: selection_count()",
          "tooltip": "",
          "value": 1.0
        },
        "image": "gear.png",
        "menuText": "View book",
        "subMenu": "Invisible"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Sort by field",
              "action_settings": {
                "sort_filters": [
                  [
                    "#lastread",
                    false
                  ]
                ]
              },
              "comment": ""
            },
            {
              "action_name": "Selection Modifier",
              "action_settings": {
                "restriction": {},
                "search": {
                  "opt": "saved",
                  "saved_search": "Recently Read"
                },
                "selection": "chain_modified"
              },
              "comment": ""
            }
          ],
          "refresh_gui": true
        },
        "image": "gear.png",
        "menuText": "View recent books",
        "subMenu": "Invisible"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Calibre Actions",
              "action_settings": {
                "disable_busy_cursor": false,
                "selection": [
                  {
                    "display": "On Device",
                    "path": [
                      "View Manager",
                      "On Device"
                    ],
                    "paths_text": "On Device"
                  }
                ]
              },
              "comment": "Switch to \"On Device\" view.",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "!=",
                "datatype": "text",
                "icon": "",
                "template": "",
                "tooltip": "",
                "value": "On Device"
              }
            }
          ],
          "refresh_gui": true
        },
        "image": "gear.png",
        "menuText": "Switch to On Device view",
        "subMenu": "Invisible"
      },
      {
        "active": true,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Switch To VL View",
              "action_settings": {
                "tabs_config": [
                  {
                    "tab_name": "Documentation & Manuals",
                    "view_name": "Documentation and Manuals"
                  },
                  {
                    "tab_name": "Comics",
                    "view_name": "Comics"
                  },
                  {
                    "tab_name": "On Device",
                    "view_name": "On Device"
                  },
                  {
                    "tab_name": "eBooks",
                    "view_name": "Default"
                  },
                  {
                    "tab_name": "Magazines & Periodicals",
                    "view_name": "Magazines"
                  },
                  {
                    "tab_name": "Fiction",
                    "view_name": "Default"
                  },
                  {
                    "tab_name": "Read",
                    "view_name": "Default"
                  },
                  {
                    "tab_name": "Nonfiction",
                    "view_name": "Nonfiction"
                  },
                  {
                    "tab_name": "Unread",
                    "view_name": "Default"
                  },
                  {
                    "tab_name": "Fanfiction",
                    "view_name": "Fanfiction"
                  },
                  {
                    "tab_name": "Physical Books",
                    "view_name": "Physical Books"
                  },
                  {
                    "tab_name": "Series",
                    "view_name": "Series"
                  },
                  {
                    "tab_name": "Loans",
                    "view_name": "Default"
                  }
                ]
              },
              "comment": ""
            },
            {
              "action_name": "Refresh GUI",
              "action_settings": {},
              "comment": ""
            }
          ],
          "refresh_gui": true
        },
        "image": "gear.png",
        "menuText": "Switch VL View",
        "subMenu": "Invisible"
      },
      {
        "active": false,
        "chain_settings": {},
        "image": "",
        "menuText": "",
        "subMenu": ""
      },
      {
        "active": false,
        "chain_settings": {
          "chain_links": [
            {
              "action_name": "Single Field Edit",
              "action_settings": {
                "col_name": "marked",
                "value_type": "clear"
              },
              "comment": "Unmark books"
            },
            {
              "action_name": "Selection Modifier",
              "action_settings": {
                "restriction": {},
                "search": {
                  "opt": "clear"
                },
                "selection": "chain_modified"
              },
              "comment": "Clear search if 0 books marked",
              "condition_settings": {
                "affect_validation": false,
                "cmp_type": "=",
                "datatype": "number",
                "icon": "",
                "template": "program:\n\tmarked = from_search('id', 'marked:true');\n\tcount(marked, ',')",
                "tooltip": "",
                "value": 0.0
              }
            },
            {
              "action_name": "Refresh Current Search",
              "action_settings": {},
              "comment": "Refresh search"
            }
          ],
          "refresh_gui": true
        },
        "image": "snippets.png",
        "menuText": "Clear marked books",
        "subMenu": "Snippets"
      }
    ]
  },
  "eventVariants": [],
  "events": {
    "eventEntries": [
      {
        "active": true,
        "event_name": "Device Connected",
        "event_settings": {
          "countdown_settings": {
            "duration": 5,
            "enabled": true,
            "message": "Action chain event starting shortly"
          },
          "event_members": [
            {
              "chain_name": "Switch to On Device view"
            }
          ],
          "validate": true
        }
      },
      {
        "active": true,
        "event_name": "VL Tab Changed",
        "event_settings": {
          "countdown_settings": {
            "enabled": false
          },
          "event_members": [
            {
              "chain_name": "Switch VL View"
            }
          ],
          "event_options": {
            "active_when_tabs_hidden": true
          },
          "validate": true
        }
      }
    ]
  },
  "eventsTableState": {
    "column_positions": {
      "active": 0,
      "errors": 3,
      "event_name": 1,
      "event_settings": 2
    },
    "column_sizes": {
      "active": 30,
      "errors": 41,
      "event_name": 300,
      "event_settings": 53
    },
    "hidden_columns": []
  },
  "gprefs": {
    "actionsTableState": {
      "column_positions": {
        "action_name": 2,
        "action_settings": 3,
        "comment": 4,
        "conditions": 0,
        "errors": 5,
        "scope": 1
      },
      "column_sizes": {
        "action_name": 162,
        "action_settings": 53,
        "comment": 397,
        "conditions": 71,
        "errors": 455,
        "scope": 41
      },
      "hidden_columns": []
    },
    "chainsTableState": {
      "column_positions": {
        "active": 0,
        "conditions": 1,
        "menuText": 2,
        "settings": 4,
        "subMenu": 3
      },
      "column_sizes": {
        "active": 53,
        "conditions": 71,
        "menuText": 282,
        "settings": 53,
        "subMenu": 103
      },
      "hidden_columns": []
    },
    "eventMembersTableState": {
      "column_positions": {
        "chain_name": 1,
        "errors": 2,
        "icons": 0
      },
      "column_sizes": {
        "chain_name": 300,
        "errors": 359,
        "icons": 30
      },
      "hidden_columns": []
    },
    "eventVariantsTableState": null,
    "eventsTableState": null,
    "varsTableState": {
      "column_positions": {
        "": 4,
        "iterate": 0,
        "name": 2,
        "runtime": 1,
        "value": 3
      },
      "column_sizes": {
        "": 577,
        "iterate": 46,
        "name": 150,
        "runtime": 57,
        "value": 150
      },
      "hidden_columns": []
    }
  },
  "schemaVersion": 1.8,
  "tabsViewsTableStates": {
    "column_positions": {
      "errors": 2,
      "tab_name": 0,
      "view_name": 1
    },
    "column_sizes": {
      "errors": 152,
      "tab_name": 300,
      "view_name": 300
    },
    "hidden_columns": []
  }
}
ownedbycats is offline   Reply With Quote
Old 01-09-2022, 05:36 PM   #786
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,091
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
It takes as long as the condition(s) take to execute. We discussed this before in regards to the selection_count() being used in a condition slowing down the menu if you have a lot of items selected (e.g thousands).

The solution back then was adding an option to the condition dialog to stop checking for the conditions when pressing the menu.

Variants should not affect this at all.

I don't know what effect running from source can have. My guess is none.
capink is offline   Reply With Quote
Old 01-09-2022, 05:52 PM   #787
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I tested. The three device-check items are what was slowing it down -- if I disable the option to grey them out the menu is faster.

A bit strange as I've been using them for a while and it wasn't slow before. I wonder if there's any recent changes in Calibre's code that would make it slower.

I'll keep them un-greyed but put them into a submenu.
ownedbycats is offline   Reply With Quote
Old 01-11-2022, 04:33 PM   #788
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quick question: Can I make an action chain to launch an external program without opening a book?

Mostly I just want to be able to launch Flaresolverr (for FanFicFare) from within Calibre itself.

Last edited by ownedbycats; 01-11-2022 at 04:54 PM.
ownedbycats is offline   Reply With Quote
Old 01-11-2022, 07:58 PM   #789
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,091
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Try this and see if it works:
  • Make a batch script that opens whatever program you want.
  • Use the open with action to open the batch script, by checking the "open with default app" option. You also need to disable multiple selections. Select the template option and use this template:
    Code:
    program:
        '/path/to/the/batch/script'
  • For this to work you need to have at least one book selected, which you can do by using the selection modifier and checking the option to select the first book in the current view.

Last edited by capink; 01-11-2022 at 08:04 PM.
capink is offline   Reply With Quote
Old 01-11-2022, 09:51 PM   #790
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by ownedbycats View Post
Quick question: Can I make an action chain to launch an external program without opening a book?

Mostly I just want to be able to launch Flaresolverr (for FanFicFare) from within Calibre itself.
I suspect you already have a tool to do that:

BR
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2022-01-12 135057.jpg
Views:	74
Size:	177.0 KB
ID:	191536  
BetterRed is offline   Reply With Quote
Old 01-13-2022, 02:26 AM   #791
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Ah, I vaguely remember Job Spy -- but I'm afraid that with Calibre 6 it may not be maintained anymore, so... I'll try a batch file.

Also, a question/possible bug report: I found that in single-field edit if a template produced a number like 91.66666666666666, it failed to update my integer column. It worked if I used the round() function. Is this intended or a bug?

Last edited by ownedbycats; 01-13-2022 at 03:12 AM.
ownedbycats is offline   Reply With Quote
Old 01-13-2022, 04:56 AM   #792
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Also, a question/possible bug report: I found that in single-field edit if a template produced a number like 91.66666666666666, it failed to update my integer column. It worked if I used the round() function. Is this intended or a bug?
It is intended. 91.666 is not an integer so can't be assigned to an integer column.
chaley is offline   Reply With Quote
Old 01-13-2022, 09:19 PM   #793
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: I'm trying to make a chain that automatically calculates the #percentread on paper books by taking an inputted current page number and calculating that against the pagecount.

I thought I could do this with chain variables, but I think I'm misunderstanding the documentation.

The first action is to set a chain variable called 'pagenum.' I left the template blank.

The second action is to then run this template:

Code:
program:
	totalpage = $#pagecount;
	pagenum = globals(pagenum);
	newpercent = round(multiply ((totalpage / pagenum), 100));
However, when I try this I get EXCEPTION: Interpreter: Error during operator evaluation: operator '/' - line number 4 and it won't let me save it.

Last edited by ownedbycats; 01-13-2022 at 09:23 PM.
ownedbycats is offline   Reply With Quote
Old 01-14-2022, 05:18 AM   #794
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,091
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Since you are using pagenum in a division, the template for pagenum in the Chain Variables has to return an numerical value, it cannot be an empty string (or any numerical string for that matter).
capink is offline   Reply With Quote
Old 01-14-2022, 05:26 AM   #795
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I'm a bit confused on what to do. Based on post #770, I set the variable to "runtime," which should pop up a dialog to let me input the number. If I run the chain with just the variable action it does that.

But then how do I use that variable in the template after setting it? I got the operator evalation error and it won't let me save it.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] Editor Chains capink Plugins 85 Today 05:50 AM
Action Chains Resources capink Plugins 54 01-29-2024 11:24 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


All times are GMT -4. The time now is 02:44 PM.


MobileRead.com is a privately owned, operated and funded community.