Skip to main content
Question

Figma plugin question: How can I find all groups in a page that have the same name?

  • October 30, 2022
  • 2 replies
  • 580 views

Akshay_Parakh

I’m building my first Figma plugin and before I can build the next functionality into my plugin, I first need to:

  1. Find all the groups that have the same name
  2. Club the ones with the same name and show them to the user (For example, 2 groups with the name ‘XYZ’, 4 groups with the name ‘ABC’, etc.)

2 replies

Gleb
  • Power Member
  • 4708 replies
  • October 30, 2022

Find all groups using findAllWithCriteria (findAllWithCriteria | Plugin API), then loop through them, record all unique names into a dictionary.


Akshay_Parakh

Hi @Gleb , I had earlier checked out the findAllWithCriteria functionality and could get to the following code:

const nodes = figma.currentPage.findAllWithCriteria({
types: [‘GROUP’]
})

However, I’m completely new to TypeScript and I’m not sure about the rest of the code.

Would it be possible for you to help me with a basic block of code to get started with


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings