Please check out my YouTube video Create a library of your downloaded icons with Excalidraw Automate in Obsidian, it provides a detailed walkthrough of this code.
To save these files into your Vault, either download them, or switch to RAW mode to copy/paste them into your Obsidian Vault. You may need to use CTRL+SHIFT+V to paste.
Icons created by the script are locked in the scene, you can right click them to select and copy them. Locking the eleemnts avoids the need for switching to view mode and ensures the file does not get accidently modified, thus the images in the image library are not actually saved to the image library causing unwanted links in your Vault.
I use the script with LOCK_ICONS=true; because in this case I won't accidently move items in the image library causing it to save the icons in the file and creating unwanted links in Excalibrain pointing back to the icon library. If you lock icons then you need to right click the selected icon to copy it to the clipboard, however, when you paste the icon to your drawing it will be locked - which is not convenient. For this reason I've also configured an onPaste event handler via the Excalidraw startup script. This automatically unlocks all elements on paste.
ea.onPasteHook = (data) => {
if(data?.payload?.elements) {
data.payload.elements.filter(el=>el.locked).forEach(el=>{el.locked = false;});
}
};


Thank you for your great video and script. As always, I am on my Samsung tablet with Android. I put the script in the Script folder and I copied the file into my vault. Then I added the word 'Icon' just to a few images and the imported file loaded a library of the images. Then I renamed altogether around 30 files. After that I always get a message and button "Scroll back to content", but the canvas remains white. I cannot debug, because I just have the tablet and cannot start the developer console. And I am also not a programmer, just know very roughly how to debug. Any suggestions? Is the functionality limited on Android devices?
Because the script wasn't working, I moved most images to another folder, but the script still didn't work. I reinstalled the script and I recreated the file from the original source, but still didn't change for the better.
But knowledge discovery via Icons is something I were totally missing before and is quite interesting. And the icons add an additional input to remember and connect the information anyway.