Skip to main content
Solved

How to set action for relaunchButtons?


I want to set two relaunchButtons on DocumentNode, I have set it with figma.root.setRelaunchData({'cmdA': 'command A', 'cmdB': 'command B' })
and I have added these in manifest.json file too.

How do I set the button actions? I want to create a rectangle shape with cmdA and a cirlce with cmdB? I want to run a method on button click.

I couldn’t find how to achieve this in the documentation. Can anyone help me with this?

Best answer by Gleb

figma.command provides that I believe but I don’t remember for sure

figma.com
View original
This topic has been closed for replies.

2 replies

Gleb
  • Power Member
  • 4708 replies
  • Answer
  • August 8, 2023

figma.command provides that I believe but I don’t remember for sure

figma.com

  • Author
  • 3 replies
  • August 8, 2023

Thanks. It’s working.

if (figma.command === 'cmdA') createRectangleA()


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