I’m trying to patch Tropy 1.16 to integrate it with ScanTailor Advanced, among other things. For my archive folders, I do the following:
- I use ScanTailor to clean up my images (creating .tiff files in ./out folder).
- I use Tesseract for batch OCR reading (creating .txt files in ./ocr folder).
- I use R to create a .json file with a Tropy Item: the archive folder in question, containing the .tiff images from ScanTailor with per-image metadata containing the path to source image and to the OCR file.
When it comes to patching Tropy’s source code, I have added buttons to Tropy’s toolbar (next to link and unlink buttons), and have created a handle that can open a fixed path .txt file when clicking the OCR button (as a test).
What I haven’t been able to figure out – I have never worked with Java Script – is how to retrieve metadata from the currently viewed photo; in my case, for example the metadata field “ocr”. I would like to do something like: electron.shell.openPath(ocrPath), where ocrPath is retrieved from metadata.
I would be very grateful if someone could give me guidance in how to access metadata.