If you are enjoying the Excalidraw plugin then please support my work and enthusiasm by buying me a coffee on https://ko-fi/zsolt.

Jump ahead to the #List of available scripts
Intorducing Excalidraw Automate Script Engine
Script Engine scripts are installed in the Downloaded subfolder of the Excalidraw Automate script folder specified in plugin settings.
In the Command Palette installed scripts are prefixed with Downloaded/, thus you can always know if you are executing a local script of your own, or one that you have downloaded from GitHub.
Attention developers and hobby hackers

If you want to modify scripts, I recommend moving them to the `Excalidraw Automate script folder` or a different subfolder under the script folder. Scripts in the `Downloaded` folder will be overwritten when you click the `Update this script` button. Note also, that at this time, I do not check if the script file has been updated on GitHub, thus the `Update this script` button is always visible once you have installed a script, not only when an update is availble (hope to build this feature in the future).
I would love to include your contribution in the script library. If you have a script of your own that you would like to share with the community, please open a PR on GitHub. Be sure to include the following in your pull request
- The script file with a self explanetory name. The name of the file will be the name of the script in the Command Palette.
- An image explaining the scripts purpose. Remember a picture speaks thousand words!
- An update to this file ea-scripts/index.md
List of available scripts
Box Selected Elements
| Author | @zsviczian |
| Source | File on GitHub |
| Description | This script will add an encapsulating box around the currently selected elements in Excalidraw.
 |
Bullet Point
| Author | @zsviczian |
| Source | File on GitHub |
| Description | This script will add a small circle to the top left of each text element in the selection and add the text and the "bullet point" into a group.
 |
Connect elements
| Author | @zsviczian |
| Source | File on GitHub |
| Description | This script will connect two objects with an arrow. If either of the objects are a set of grouped elements (e.g. a text element grouped with an encapsulating rectangle), the script will identify these groups, and connect the arrow to the largest object in the group (assuming you want to connect the arrow to the box around the text element).
 |
Convert text to link with folder and alias
| Author | @zsviczian |
| Source | File on GitHub |
| Description | Converts text elements to links pointing to a file in a selected folder and with the alias set as the original text. The script will prompt the user to select an existing folder from the vault.
original text - [[selected folder/original text|original text]] |
Create new markdown file and embed into active drawing
| Author | @zsviczian |
| Source | File on GitHub |
| Description | The script will prompt you for a filename, then create a new markdown document with the file name provided, open the new markdown document in an adjacent pane, and embed the markdown document into the active Excalidraw drawing.
 |
Darken background color
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | This script darkens the background color of the selected element by 2% at a time. You can use this script several times until you are satisfied. It is recommended to set a shortcut key for this script so that you can quickly try to DARKEN and LIGHTEN the color effect. In contrast to the `Modify background color opacity` script, the advantage is that the background color of the element is not affected by the canvas color, and the color value does not appear in a strange rgba() form.
 |
Dimensions
| Author | @zsviczian |
| Source | File on GitHub |
| Description | Currently there is no way to specify the exact location and size of objects in Excalidraw. You can bridge this gap with the following simple script.
 |
Elbow connectors
Expand rectangles horizontally keep text centered
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | This script expands the width of the selected rectangles until they are all the same width and keep the text centered.
 |
Expand rectangles horizontally
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | This script expands the width of the selected rectangles until they are all the same width.
 |
Expand rectangles vertically keep text centered
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | This script expands the height of the selected rectangles until they are all the same height and keep the text centered.
 |
Expand rectangles vertically
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | This script expands the height of the selected rectangles until they are all the same height.
 |
Fixed spacing
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | The script arranges the selected elements horizontally with a fixed spacing. When we create an architecture diagram or mind map, we often need to arrange a large number of elements in a fixed spacing. `Fixed spacing` and `Fixed vertical Distance` scripts can save us a lot of time.
 |
Fixed vertical distance
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | The script arranges the selected elements vertically with a fixed spacing. When we create an architecture diagram or mind map, we often need to arrange a large number of elements in a fixed spacing. `Fixed spacing` and `Fixed vertical Distance` scripts can save us a lot of time.
 |
Font Family
| Author | @zsviczian |
| Source | File on GitHub |
| Description | Sets font family of the text block (Virgil, Helvetica, Cascadia). Useful if you want to set a keyboard shortcut for selecting font family.
 |
Grid
| Author | @zsviczian |
| Source | File on GitHub |
| Description | The default grid size in Excalidraw is 20. Currently there is no way to change the grid size via the user interface. This script offers a way to bridge this gap.
 |
Lighten background color
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | This script lightens the background color of the selected element by 2% at a time. You can use this script several times until you are satisfied. It is recommended to set a shortcut key for this script so that you can quickly try to DARKEN and LIGHTEN the color effect.In contrast to the `Modify background color opacity` script, the advantage is that the background color of the element is not affected by the canvas color, and the color value does not appear in a strange rgba() form.
 |
Modify background color opacity
| Author | @1-2-3 |
| Source | File on GitHub |
| Description | This script changes the opacity of the background color of the selected boxes. The default background color in Excalidraw is so dark that the text is hard to read. You can lighten the color a bit by setting transparency. And you can tweak the transparency over and over again until you're happy with it. Although excalidraw has the opacity option in its native property Settings, it also changes the transparency of the border. Use this script to change only the opacity of the background color without affecting the border. |
Modify stroke width of selected elements
| Author | @zsviczian |
| Source | File on GitHub |
| Description | This script will set the stroke width of selected elements. This is helpful, for example, when you scale freedraw sketches and want to reduce or increase their line width.
 |
OCR - Optical Character Recognition
| Author | @zsviczian |
| Source | File on GitHub |
| Description | The script will 1) send the selected image file to [taskbone.com](https://taskbone.com) to exctract the text from the image, and 2) will add the text to your drawing as a text element.
 |
Reverse arrows
| Author | @zsviczian |
| Source | File on GitHub |
| Description | Reverse the direction of **arrows** within the scope of selected elements.
 |
Set Link Alias
| Author | @zsviczian |
| Source | File on GitHub |
| Description | Iterates all of the links in the selected TextElements and prompts the user to set or modify the alias for each link found.
 |
Split text by lines
| Author | @zsviczian |
| Source | File on GitHub |
| Description | Split lines of text into separate text elements for easier reorganization
 |
Text Align
| Author | @zsviczian |
| Source | File on GitHub |
| Description | Sets text alignment of text block (cetner, right, left). Useful if you want to set a keyboard shortcut for selecting text alignment.
 |
Transfer TextElements to Excalidraw markdown metadata
| Author | @zsviczian |
| Source | File on GitHub |
| Description | The script will delete the selected text elements from the canvas and will copy the text from these text elements into the Excalidraw markdown file as metadata. This means, that the text will no longer be visible in the drawing, however you will be able to search for the text in Obsidian and find the drawing containing this image.
 |
Zoom to Fit Selected Elements