**Created**:: [[2022-01-01 Saturday]] **Link**:: https://youtu.be/W2NMzR8s4eE **Duration**:: 6:08 ![OCR with Excalidraw in Obsidian: Extract text from images and add as metadata to your files](https://youtu.be/W2NMzR8s4eE) # Summary In this video, the presenter demonstrates how to extract text from images using Excalidraw and automate the process in Obsidian with specific scripts. By transferring the extracted text into markdown metadata, users can easily search for content within their drawings. This enhances organization and retrieval in a visual knowledge management system. # Key Takeaways - **OCR Integration**: Understand how to integrate Optical Character Recognition (OCR) scripts into Excalidraw for extracting text from images. - **Metadata Usage**: Learn how to transfer extracted text into the markdown metadata of your documents for easier search and retrieval. - **Script Installation**: Follow the step-by-step process to install and use necessary scripts from the Excalidraw automate library within Obsidian. # Content In today's video, we are going to be extracting the text from this image using an Excalidraw automate script. Then we are going to edit this text just slightly. Once we've edited the text and we're happy with it, we are going to move this text into the markdown metadata of this document, meaning that the text disappears from the picture. But if I open up the markdown view of this document, then in the metadata I can see this is a demo and box arrow diamond listed here. What this will allow me to do is to search for this text. For example, I’m just selecting this part of the text here, and when I'm, let's say, on a different image, I can go to search and I can search for the text that I've just selected, and I'm going to be able to find my drawing based on the metadata which is taken from the image. So now let's roll back time and see how I got to this point. [* ](https://youtu.be/W2NMzR8s4eE) So you will need to install two scripts to make all of this work, and you will need to follow the link provided in the video description to the EA scripts library. Here you find all of the scripts that are available for Excalidraw automate that you can install into Obsidian. On this list, if we scroll down, we will find the Optical Character Recognition script and the Transfer Text Elements to Excalidraw Metadata script—these are the two scripts that we need. So how do we get this into Excalidraw? First, I will click here on the link to the script. This is the script itself; you don't need to read it, and you don't need to worry about it. Of course, if you want, you may want to go through it and understand what's going on here. What you need to do is to click here to copy raw contents, and then you need to head over to Obsidian. [* ](https://youtu.be/W2NMzR8s4eE) In Obsidian, we will need to open up the location for our Excalidraw scripts. In my case, this is Excalidraw scripts, and I have all my different scripts available here. So I'm going to make a new note here, and I'm going to title this note OCR and I'm simply going to press Ctrl + V to paste the text in here. When I'm done, I can head back to GitHub to copy the other script, so let me do that quickly. Here we will need to move up a level, scroll down to Transfer Text Elements to Excalidraw, and again here, I'm going to click on Copy Raw Contents. So when I'm done with that as well, I go back to Obsidian and in Obsidian, I'm going to create a new note. I'm going to call it Transfer to Metadata—you can give it whatever name you prefer—and I'm going to Ctrl + V paste the text in here, and I have my script, so now I'm ready for the first run. [* ](https://youtu.be/W2NMzR8s4eE) There's an important piece of information. If I go back to the OCR script, I have a description here, and there's this important piece of information: don’t forget to paste the token into your script after the first run. So when you first use this OCR service, the script is going to request a personal token from you, and you will need to update the code right here and install that token. This way, you can use the same token over and over instead of always having to create one for yourself if you use this feature frequently. There's also a premium service available by Taskbone, and you can head over to taskbone.com to read about their premium service offering, and you can get a premium token as well, which you can insert in here just the same. [* ](https://youtu.be/W2NMzR8s4eE) So let's do the first run. All I need to do is create a new drawing. For now, for the first run, you don't even need an image; of course, you can already paste an image. If I press Ctrl + P to bring up the command palette and I search for OCR, then I already have my Excalidraw OCR script. You'll see that I get a message to update the script engine with the token. The token is on the clipboard and in the developer console. So I need to head over to my script, and all I need to do is here under the token, I press—or between the quotation marks—I just simply press Ctrl + V to insert my token, and that's all. With that, you have your token installed, and if we head back to the sketch, then we can do our first experiment copying in an image from the internet and doing a scan. [* ](https://youtu.be/W2NMzR8s4eE) # YouTube Details ## YouTube Description It seems unfortunately that the https://ocr.taskbone.com service is no longer available. I will retire this script from the script library. Watch also: - How to convert your images into first-class citizens in your Obsidian knowledge graph by adding rich metadata using Excalidraw markdown view: https://youtu.be/8payWdWI2cQ - Introducing the Excalidraw ScriptEngine: https://youtu.be/hePJcObHIso --------- If you find the plugin and/or my videos helpful, please say thanks by buying me a coffee: https://ko-fi.com/zsolt If you'd like to request a feature or report a bug, please raise it on GitHub: https://github.com/zsviczian/obsidian-excalidraw-plugin If you want to connect, you can reach me (@zsviczian) in the Obsidian Members Group (OMG) on Discord or on Twitter. Links --------- Scripts library: https://github.com/zsviczian/obsidian-excalidraw-plugin/tree/master/ea-scripts Excalidraw ScriptEngine How To: https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html Obsidian OCR plugin by schlundd: https://github.com/schlundd/obsidian-ocr-plugin taskbone.com: https://taskbone.com My blog: https://zsolt.blog ## YouTube Transcript [in today's video we are going to be](https://youtu.be/W2NMzR8s4eE?t=0) [extracting the text from this image](https://youtu.be/W2NMzR8s4eE?t=2) [using an x color draw automate script](https://youtu.be/W2NMzR8s4eE?t=5) [and then we are going to edit this text](https://youtu.be/W2NMzR8s4eE?t=8) [just slightly](https://youtu.be/W2NMzR8s4eE?t=12) [and](https://youtu.be/W2NMzR8s4eE?t=14) [once we've edited the text and we're](https://youtu.be/W2NMzR8s4eE?t=16) [happy with it we are going to be moving](https://youtu.be/W2NMzR8s4eE?t=18) [this text into the](https://youtu.be/W2NMzR8s4eE?t=21) [markdown metadata of this document](https://youtu.be/W2NMzR8s4eE?t=23) [meaning](https://youtu.be/W2NMzR8s4eE?t=26) [[Music]](https://youtu.be/W2NMzR8s4eE?t=28) [meaning that the text disappears from](https://youtu.be/W2NMzR8s4eE?t=30) [the](https://youtu.be/W2NMzR8s4eE?t=33) [picture](https://youtu.be/W2NMzR8s4eE?t=34) [but if i open up](https://youtu.be/W2NMzR8s4eE?t=36) [the markdown view of this document then](https://youtu.be/W2NMzR8s4eE?t=38) [in the metadata i can see this is a demo](https://youtu.be/W2NMzR8s4eE?t=41) [and box arrow diamond listed here and](https://youtu.be/W2NMzR8s4eE?t=44) [what this will allow me to do is to](https://youtu.be/W2NMzR8s4eE?t=48) [search for this text](https://youtu.be/W2NMzR8s4eE?t=51) [for example i'm just selecting this part](https://youtu.be/W2NMzR8s4eE?t=52) [of the text here](https://youtu.be/W2NMzR8s4eE?t=55) [and when i'm let's say on a different](https://youtu.be/W2NMzR8s4eE?t=57) [image](https://youtu.be/W2NMzR8s4eE?t=60) [like this i can go to search and i can](https://youtu.be/W2NMzR8s4eE?t=61) [search for the text that i've just](https://youtu.be/W2NMzR8s4eE?t=65) [selected and i'm going to be](https://youtu.be/W2NMzR8s4eE?t=67) [able to find my drawing](https://youtu.be/W2NMzR8s4eE?t=70) [based on the metadata which](https://youtu.be/W2NMzR8s4eE?t=73) [is taken from the image](https://youtu.be/W2NMzR8s4eE?t=76) [so now let's](https://youtu.be/W2NMzR8s4eE?t=79) [roll back time and see how i got to this](https://youtu.be/W2NMzR8s4eE?t=80) [point](https://youtu.be/W2NMzR8s4eE?t=83) [so you will need to install two scripts](https://youtu.be/W2NMzR8s4eE?t=93) [to make all of this work](https://youtu.be/W2NMzR8s4eE?t=96) [and you will need to follow the link](https://youtu.be/W2NMzR8s4eE?t=98) [provided in the video description to the](https://youtu.be/W2NMzR8s4eE?t=100) [ea scripts library and here you find all](https://youtu.be/W2NMzR8s4eE?t=103) [of the scripts that are available for](https://youtu.be/W2NMzR8s4eE?t=107) [xcalitra automate that you can install](https://youtu.be/W2NMzR8s4eE?t=109) [into obsidian](https://youtu.be/W2NMzR8s4eE?t=113) [and](https://youtu.be/W2NMzR8s4eE?t=114) [on in this list if we scroll down we](https://youtu.be/W2NMzR8s4eE?t=115) [will find](https://youtu.be/W2NMzR8s4eE?t=119) [the](https://youtu.be/W2NMzR8s4eE?t=120) [optical character recognition script and](https://youtu.be/W2NMzR8s4eE?t=121) [the transfer text elements to exclude](https://youtu.be/W2NMzR8s4eE?t=124) [markdown metadata script these are the](https://youtu.be/W2NMzR8s4eE?t=127) [two scripts that we need so how do we](https://youtu.be/W2NMzR8s4eE?t=130) [get this](https://youtu.be/W2NMzR8s4eE?t=132) [into](https://youtu.be/W2NMzR8s4eE?t=133) [xcolitra](https://youtu.be/W2NMzR8s4eE?t=134) [first i will click here on the link to](https://youtu.be/W2NMzR8s4eE?t=136) [the script](https://youtu.be/W2NMzR8s4eE?t=139) [and all i need to do so this is the](https://youtu.be/W2NMzR8s4eE?t=140) [script itself you don't need to read it](https://youtu.be/W2NMzR8s4eE?t=143) [you don't need to worry about it of](https://youtu.be/W2NMzR8s4eE?t=145) [course if you want](https://youtu.be/W2NMzR8s4eE?t=146) [you may want to go through it and](https://youtu.be/W2NMzR8s4eE?t=148) [understand what's going on here what you](https://youtu.be/W2NMzR8s4eE?t=150) [need to do is to click here to copy](https://youtu.be/W2NMzR8s4eE?t=152) [raw contents](https://youtu.be/W2NMzR8s4eE?t=156) [and then you need to head over to](https://youtu.be/W2NMzR8s4eE?t=158) [obsidian and](https://youtu.be/W2NMzR8s4eE?t=160) [in obsidian](https://youtu.be/W2NMzR8s4eE?t=162) [we will need to open up the location for](https://youtu.be/W2NMzR8s4eE?t=164) [our excalibur scripts in my case this is](https://youtu.be/W2NMzR8s4eE?t=167) [xcalitra](https://youtu.be/W2NMzR8s4eE?t=170) [script and i have all my](https://youtu.be/W2NMzR8s4eE?t=172) [different scripts available here so i'm](https://youtu.be/W2NMzR8s4eE?t=174) [going to make a new note here and i'm](https://youtu.be/W2NMzR8s4eE?t=177) [going to title this note](https://youtu.be/W2NMzR8s4eE?t=179) [ocr and i'm simply going to](https://youtu.be/W2NMzR8s4eE?t=182) [press ctrl v to paste the text in here](https://youtu.be/W2NMzR8s4eE?t=185) [and when i'm done i can head back to](https://youtu.be/W2NMzR8s4eE?t=190) [github to copy the other script so let](https://youtu.be/W2NMzR8s4eE?t=193) [me do that quickly so here we will need](https://youtu.be/W2NMzR8s4eE?t=195) [to move up a level](https://youtu.be/W2NMzR8s4eE?t=197) [scroll down](https://youtu.be/W2NMzR8s4eE?t=200) [to transfer text elements to x color](https://youtu.be/W2NMzR8s4eE?t=202) [draw](https://youtu.be/W2NMzR8s4eE?t=204) [and again here i'm going to click on](https://youtu.be/W2NMzR8s4eE?t=205) [copy raw contents](https://youtu.be/W2NMzR8s4eE?t=209) [so when i'm done with that as well i go](https://youtu.be/W2NMzR8s4eE?t=211) [back to obsidian and in obsidian i'm](https://youtu.be/W2NMzR8s4eE?t=214) [going to create a new note i'm going to](https://youtu.be/W2NMzR8s4eE?t=216) [call it](https://youtu.be/W2NMzR8s4eE?t=219) [transfer](https://youtu.be/W2NMzR8s4eE?t=220) [to](https://youtu.be/W2NMzR8s4eE?t=222) [metadata you can give it whatever name](https://youtu.be/W2NMzR8s4eE?t=223) [you prefer](https://youtu.be/W2NMzR8s4eE?t=226) [and i'm going to ctrl v paste the text](https://youtu.be/W2NMzR8s4eE?t=227) [in here and i have my script so now i'm](https://youtu.be/W2NMzR8s4eE?t=231) [ready for the first run there's an](https://youtu.be/W2NMzR8s4eE?t=234) [important piece of information so if i](https://youtu.be/W2NMzR8s4eE?t=236) [go back to the ocr script i have a](https://youtu.be/W2NMzR8s4eE?t=239) [description here and there's this](https://youtu.be/W2NMzR8s4eE?t=241) [important piece of information don't](https://youtu.be/W2NMzR8s4eE?t=243) [forget to paste the token into your](https://youtu.be/W2NMzR8s4eE?t=245) [script after the first run](https://youtu.be/W2NMzR8s4eE?t=248) [so when you first](https://youtu.be/W2NMzR8s4eE?t=250) [use this ocr service](https://youtu.be/W2NMzR8s4eE?t=252) [the script is going to request](https://youtu.be/W2NMzR8s4eE?t=254) [a personal token for you and you will](https://youtu.be/W2NMzR8s4eE?t=257) [need to update the code right here and](https://youtu.be/W2NMzR8s4eE?t=259) [install that token so you can use the](https://youtu.be/W2NMzR8s4eE?t=262) [same token over and over instead of](https://youtu.be/W2NMzR8s4eE?t=265) [always having to create one for yourself](https://youtu.be/W2NMzR8s4eE?t=267) [if you use this feature frequently](https://youtu.be/W2NMzR8s4eE?t=271) [there's also a premium service available](https://youtu.be/W2NMzR8s4eE?t=273) [by](https://youtu.be/W2NMzR8s4eE?t=277) [taskbone and you can head over to](https://youtu.be/W2NMzR8s4eE?t=278) [taskboom.com](https://youtu.be/W2NMzR8s4eE?t=280) [and you can read about their premium](https://youtu.be/W2NMzR8s4eE?t=282) [service offering and you can get a](https://youtu.be/W2NMzR8s4eE?t=285) [premium token as well which you can](https://youtu.be/W2NMzR8s4eE?t=288) [insert in here](https://youtu.be/W2NMzR8s4eE?t=291) [just the same](https://youtu.be/W2NMzR8s4eE?t=293) [so let's do the first run all i need to](https://youtu.be/W2NMzR8s4eE?t=294) [do is to create a new drawing](https://youtu.be/W2NMzR8s4eE?t=298) [and for now](https://youtu.be/W2NMzR8s4eE?t=300) [for the first run you don't even need a](https://youtu.be/W2NMzR8s4eE?t=301) [an image of course you can already paste](https://youtu.be/W2NMzR8s4eE?t=304) [an image](https://youtu.be/W2NMzR8s4eE?t=306) [but if i press control p](https://youtu.be/W2NMzR8s4eE?t=308) [to bring up the command palette and i](https://youtu.be/W2NMzR8s4eE?t=311) [search for ocr then i already have my](https://youtu.be/W2NMzR8s4eE?t=314) [xcalitra ocr script and you will see](https://youtu.be/W2NMzR8s4eE?t=317) [that](https://youtu.be/W2NMzR8s4eE?t=320) [i get a message to update the script](https://youtu.be/W2NMzR8s4eE?t=321) [engine with the token token is on the](https://youtu.be/W2NMzR8s4eE?t=324) [clipboard and in the developer console](https://youtu.be/W2NMzR8s4eE?t=326) [so i need to](https://youtu.be/W2NMzR8s4eE?t=330) [head over to my script and all i need to](https://youtu.be/W2NMzR8s4eE?t=331) [do is here under the token i press](https://youtu.be/W2NMzR8s4eE?t=335) [or between the quotation marks i just](https://youtu.be/W2NMzR8s4eE?t=338) [simply press ctrl v](https://youtu.be/W2NMzR8s4eE?t=341) [to insert my token and that's all with](https://youtu.be/W2NMzR8s4eE?t=343) [that](https://youtu.be/W2NMzR8s4eE?t=346) [you have your token installed and if we](https://youtu.be/W2NMzR8s4eE?t=346) [head back to the sketch](https://youtu.be/W2NMzR8s4eE?t=350) [then we can](https://youtu.be/W2NMzR8s4eE?t=353) [do our first experiment copying](https://youtu.be/W2NMzR8s4eE?t=354) [in an image from the internet and doing](https://youtu.be/W2NMzR8s4eE?t=357) [a scan in today's video we are going to](https://youtu.be/W2NMzR8s4eE?t=361) [be extracting the text from this image](https://youtu.be/W2NMzR8s4eE?t=364)