How to automate logo creation in Figma with bots

Cover image

If you're doing repetitive tasks such as creating logos for clients and yourself in Figma, you can automate the whole process with bots.

Follow along to learn how to create this bot that can create and export a new logo in less than 30 seconds:

Full walkthrough

Here are the steps we're going to take:

1. Preparation

2. Log in to your Figma account

3. Create logo

4. Export and download logo zip file

Let's create a logo for a client. They are asking for a logo for their website

1. Preparation

Here's what we'll use:

1. Python 🐍

2. Selenium WebDriver 🤖

3. Chrome web browser ⚙️

To be able to interact with websites with Selenium, we need to locate the full XPath of each element we want to interact with. If you like to type your email in the text field where you're writing your email, you need to locate the XPath for that particular text field.

The first step is installing and then importing all the Selenium packages. You'll find installation guides here

Once you have Selenium and a Chrome driver, go ahead and import the packages:

from selenium import webdriver
from import WebDriverWait 
from selenium.webdriver.common.keys import Keys
from import By
from selenium.webdriver.common.action_chains import ActionChains
from import expected_conditions as EC

Before we start the browser and log in to our Figma account, let's create 2 functions for common operations that we'll use throughout the automation; writing in text areas and clicking on buttons.

1. Function for typing in text areas

This function will locate an element according to its full XPath, click in the text area, and type each word in a string with a 400-millisecond delay.

def type_in_text_area(element_xpath, text_string, delay=2):
    Type words into a text area

    # Find text area with its XPath
    text_area = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.XPATH, element_xpath)))

    # Start an action chain
    action = ActionChains(driver)

    for letter in text_string:

2. Function for clicking on buttons

This function will locate an element according to its full XPath and hold-click on it.

def click_hold_button(element_xpath, delay=2):
    Click and hold a button

    button = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.XPATH, element_xpath)))

2. Login to your Figma account

Start the web driver; this will open a new Chrome window:

driver = webdriver.Chrome()

Define the pages you like to route to when the web driver is up and visit the page:

page = ""

driver.get(page) will take you to the login page of Figma. To log in and start the project, create two variables with your login credentials:


You can now type your email into the email text field by locating the XPath for the text field. Locate the XPath by inspecting the text field. Start by right-clicking on the element and choosing inspect in the menu.

Inspect the element you want to interact with

If the inspector happens to open up to the right (or left) - make sure to dock it to the bottom:

Dock the inspector to the bottom

Here's how the inspector should be docked to the bottom, and you'll also see a banner saying that Chrome is being controlled by automated test software:

Inspector docked to the bottom

Inspect the text area by first clicking on (1) and then click on (2):

Select an element to inspect

Once you have clicked on the element you'd like to inspect, you'll see the element highlighted in the inspector:

Highlighted element in the inspector

To get the full XPath of the inspected element, right-click in the highlighted area, hover Copy, and finally click on Copy full XPath

Copy full XPath of inspected element

Now that you have the full XPath copied, return to the code and create a variable with the path:

email_path = "/html/body/div[1]/div/div[1]/form/input[1]"

Do the same for the XPath of the password text field:

Copy full XPath of password text area

Add the copied XPath of the password text field to the code:

passw_path = "/html/body/div[1]/div/div[1]/form/input[2]"

The last element needed to be able to log in is the XPath of the log-in button. Follow the same procedure and copy the XPath of the login button. The final code snippet with the 3 XPaths should look something like this:

email_path = "/html/body/div[1]/div/div[1]/form/input[1]"
passw_path = "/html/body/div[1]/div/div[1]/form/input[2]"
login_button = "/html/body/div[1]/div/div[1]/form/button[2]"

Next, write your email address and password to the text fields and click on the login button. For this, we'll use the two functions we created earlier. Run this snippet, and you should see the text fields get populated with your email and password, and then the log-in button gets clicked.


email_path = "/html/body/div[1]/div/div[1]/form/input[1]"
passw_path = "/html/body/div[1]/div/div[1]/form/input[2]"
login_button = "/html/body/div[1]/div/div[1]/form/button[2]"

type_in_text_area(email_path, email)
type_in_text_area(passw_path, passw)


Run the code and you should now see your Figma dashboard:

Figma dashboard

Let's head over to the next part, creating a new design file and a logo.

3. Create the logo

The first step of creating a logo now that we're logged in is to create a new design file. The full XPath to create a new file is /html/body/div[2]/div/div/div[1]/div[3]/div[5]/div[3]/a[1] combine that with clicking on the button like this:

# Create new design file
new_design_file_xpath = "/html/body/div[2]/div/div/div[1]/div[3]/div[5]/div[3]/a[1]"


Now that we have a new design file, let's use the Figma shortcut T to switch to the text tool and create a new text.

# Pick the text tool
text_tool_xpath = "/html/body/div[2]/div/div/div[1]/div/div[2]/div/div[2]/div[5]"


When the text tool is chosen, go ahead and click on the canvas and start typing the logo text:

# Click on canvas
canvas_xpath = "/html/body/div[2]/div/div/div[1]/div/div[1]/div/div/div/div[1]/div/div/canvas"

# Write logo text
logo_text = "LOGO_TEXT"

Time to change the font size and pick the font you want to use for the logo. I'll go with 100 pt and the font Mama and Papa. Highlight the logo text first. This snippet runs the command ⌘ + a - if you're in Windows, switch Keys.COMMAND to Keys.CONTROL instead.

# Highlight logo text
# Use Keys.CONTROL if on Windows, Keys.COMMAND is for MacOS

Click on the font size and delete the current size:

# Click on font size
font_size_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[5]/div/div[1]/div[3]/div[2]/div[2]/div/label/input"
font_size_area = driver.find_element(By.XPATH, font_size_xpath)

# Delete font size

Choose a new font size and finish by pressing the return key:

# Choose a new font size
size = "100"
type_in_text_area(font_size_element, size)

# Confirm new font size

Font size is updated, now change to the font you want to use for the logo:

# Click on font
font_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div[1]/div/div[1]/span/span[2]/div[5]/div/div[1]/div[3]/div[1]/div/input"

font_textfield = driver.find_element(By.XPATH, font_name_input)

# Delete the current font

font_name = "YOUR_FONT"

# Type new font name

So far, we have written the logo text and changed the size and font. The last step is to vectorize the text and duplicate the layer into 3 colors.

Start with hitting the escape key to deselect the logo layer:


Then vectorize the text layer and duplicate the flattened layer:

# Vectroize text layer by flatten the text

# Duplicate once

# Duplicate again

Used shortcuts:

⌘ + e = flatten text layer to vectorize

⌘ + d = duplicate layer

⌘ + r = rename layer

⌘ + a = select all layers

If you're on Windows, switch all Keys.COMMAND to Keys.CONTROL

We duplicated the layer to create 3 different versions of the logo, one in white, black, and color of your choice. Let's rename the layers to keep track of each one:

# First layer is already selected
# Change name to white
# Use Keys.CONTROL if on Windows, Keys.COMMAND is for MacOS
ActionChains(driver).key_down(Keys.COMMAND).send_keys("r").key_up(Keys.COMMAND).send_keys(Keys.ARROW_RIGHT).send_keys(' white').send_keys(Keys.ENTER).perform()

# Change vector color to white
color_picker_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[8]/div/div/div[3]/div/div/div/div/div/div/div[1]/div/div/div"

# Click on second layer
vector_layer_2 = "/html/body/div[2]/div/div/div[1]/div/div[9]/div[1]/div/div[2]/div/div/div/div/div[1]/div[2]/span[3]"

# Change name to black
ActionChains(driver).key_down(Keys.COMMAND).send_keys("r").key_up(Keys.COMMAND).send_keys(Keys.ARROW_RIGHT).send_keys(' black').send_keys(Keys.ENTER).perform()

# Change vector color to black

# Click last layer
vector_layer_3 = "/html/body/div[2]/div/div/div[1]/div/div[9]/div[1]/div/div[2]/div/div/div/div/div[1]/div[1]/span[3]"

# Recolor last layer
logo_color = "YOUR_LOGO_COLOR"

The logo and its different color variants are all set. The last step is exporting the logo in 3 different file formats: PNG, JPG, and SVG.

4. Export the logo and save it in 3 file formats

Start with selecting all the layers to export all of them at once:

# Select all layers
# Use Keys.CONTROL if on Windows, Keys.COMMAND is for MacOS

Next up is clicking on the export panel to start exporting:

export_panel_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[13]/div"

The first format is now png. Let's create another file format by clicking on the plus sign:

plus_button_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[13]/div/div[1]/div[1]/div/div[2]/span[2]"

This will automatically add a version 2x the size and with a pre-populated suffix. I want all the files in the same magnification, so let's change back to 1x size:

size_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[13]/div/div[1]/div[2]/div[1]/div/div/div[2]/input"


Go ahead and delete the suffix as well:

# Click on the suffix
suffix_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[13]/div/div[1]/div[2]/div[1]/div/div/input"

# Delete suffix

Choose JPG for the file type:

# Choose JPG as file type
dropdown_file_type_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[13]/div/div[1]/div[2]/div[1]/div/div/div[3]/div[2]/span[1]"

dropdown_button = WebDriverWait(driver, 4).until(EC.presence_of_element_located((By.XPATH, dropdown_file_type_xpath)))

# Use arrows to navigate in the dropdown

Lastly, add a new export file and choose SVG as the file type:

# Add new file type

# Change suffix for SVG

# Delete the suffix

# Use arrow keys to navigate in dropdown list
dropdown_button = WebDriverWait(driver, 4).until(EC.presence_of_element_located((By.XPATH, dropdown_file_type_xpath)))

Finally, click on export:

export_button_xpath = "/html/body/div[2]/div/div/div[1]/div/div[10]/div/div/div[2]/div/div/div/div[1]/span/span[2]/div[13]/div/div[2]/div/button"


Here's what the complete walkthrough looks like when you run all the code:

Full walkthrough

And here's the final logo I created for the client:

Final logo


1. Preparation

2. Log in to your Figma account

3. Create logo

4. Export and download logo zip file

Next steps

1. Repo with source code

Here is the repo with a Jupyter notebook with all the source code if you'd like to implement this on your own ⬇️

2. Want this but don't feel like coding?

Shoot me a DM on Twitter, I'd love to help out @norahsakal

3. Looking for your next business idea or a new side project? 💡

If you liked the logo, you might enjoy my weekly newsletter; Daily Domain Ideas
Every Monday you'll get 3 business ideas with expired .com domains

The domain is actually expired and was part of the newsletter issue #016
Idea: A site for finding recipes to make a rich, foamy, creamy cashew coffee ⬇️

Final logo

Need tailored AI solutions?

I provide one-on-one collaboration and custom AI services for businesses.

Let's find the perfect solution for your challenges: Consulting Services

Get notified about new posts
Connect with me
Need a custom solution for your business or idea?
Get a tailored blog post on ChatGPT, GPT-3 and GPT-4 to tackle your specific problem.