I've got a proof-of-concept working without too much trouble. I'm going to wait until I have the ability to safely save/load multiple json configurations that can then be selected to use in a headless Automate List run by passing the unique file name (without the .json extension) as a parameter to the plugin before releasing a beta.
As it is right now, the new Save Config button saves the currently loaded config to a hardcoded "headless.json" file, and is picked up in an automated list by the same hardcoded file name. One has to:
1) save a config from the gui
2) check the "Plugin runs headless in Automate Lists" checkbox in the gui config dialog (it's unchecked by default because I don't want to mess up any existing automate lists that are already using TagMechanic as is), and then
3) add a SetPluginParameter tool (with any value for now) to an automated list before the TagMechanic plugin. This will eventually need to match the saved config file (minus the .json extension).
Just know that the headless config will run on ALL text files in the epub (not just the ones selected in Book Browser like in the GUI version). And that there are no guardrails like with the gui versions. No pre-commit report to approve of. The changes WILL be committed where found, so be certain your parameters are doing exactly what you want before saving your epub (or better yet, create a Sigil checkpoint so you can easily roll back any mistakes).
If you want to see any debug output, you'll need to temporarily change the autoclose tag in TagMechanic's plugin.xml file from true to false (and relaunch Sigil).
Last edited by DiapDealer; 09-18-2024 at 08:29 PM.
|