How To load scripts for plugins during runtime

I'm trying to create OCR plugin similar to what mentioned #807

I tried tessaract.js in browser environment its working fine

I tried tesseract.js in node.js environment it working fine there too

But when it comes to adding to a Joplin plugin its giving some path error.

It requires us to give paths of certain js files during runtime and the paths Im getting are

E:\Joplin-ocr-plugin\file:\C:\Users\mtaru\AppData\Local\Programs\Joplin\resources\app.asar\services\node_modules\tesseract.js\dist\worker.min.js

when I just need

E:\Joplin-ocr-plugin\node_modules\tesseract.js\dist\worker.min.js

Any Suggestions, or more Description of problem required?

I believe this plugin - GitHub - ylc395/joplin-plugin-ocr: Joplin OCR plugin, extract text from images, videos, pdf documents in your Joplin notes - is tesseract based.

1 Like

Thanks for such a quick reply, I didn't knew about this before. :grinning: