Skip to main content
Solved

Matching elements across Frames

  • November 26, 2024
  • 5 replies
  • 30 views

Malthe_Gram

Hi.

Is there some way that I can know that certain elements are the same across Frames?

Example wise, the red rectangles on the left, needs to be the same across frames, but they don’t share ID, or anything else, besides possibly the name.

Is there any way to match these elements?

Thank you in advance.

Best answer by tank666

Yes, you can write a function that will check the properties for compliance, for example, name, width, height, fills, fillStyleId, etc. of the objects you need.

View original

5 replies

tank666
  • 4863 replies
  • Answer
  • November 26, 2024

Yes, you can write a function that will check the properties for compliance, for example, name, width, height, fills, fillStyleId, etc. of the objects you need.


Malthe_Gram
  • Author
  • 2 replies
  • November 26, 2024

@tank666 This was also my original thought. However as the elements can be placed differently, and have different height and width values, based on their format, these data can differ.


tank666
  • 4863 replies
  • November 26, 2024

Since the properties of these elements are different (not the same), then we can consider that they are different elements.


Malthe_Gram
  • Author
  • 2 replies
  • November 26, 2024

@tank666 I understand that’s how you see, and Figma aswell, but thats not the case for my needs.


tank666
  • 4863 replies
  • November 26, 2024

In that case, I think you need to decide for yourself what criteria to use to detect matches. Perhaps, in addition to the name (which can be changed by the user), you should check the node type (frame, rectangle, vector, instance, etc.). If the node is an instance, you can check its main component.


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