FWIW,
You can use Regex to capture all img tags and use a capture group to extract a file name.
A full book path would be better in case of duplicate files names with different images in different folders (eg. chapter1/figure1.png vs chapter2/figure1.png) but probably overkill.
Then looking up the extracted file name in your python dict (read in from csv once at the beginning) and adding in alt to create the replacement in Python Function Replace, should be easier than a full plugin and quite robust.
But to each their own approach. I replacement table could be a useful generic python function find replace tool to have in a users bag of tools.
Last edited by KevinH; 06-30-2025 at 12:05 PM.
|