if (figma.command === 'menu command string') {
// do something
}
Please see this plugin example:
github.com
Hey, thx a lot @tank666
Can you suggest where exactly to declare the if statement? I tried to put it at the same place where I check figma ui message to perform operations based on the UI input. But it doesnโt seams to work.
Add this condition outside the figma.ui
.
Yep, that worked with console log, thx. But all my logic and functions for the plugin leaves inside the figma.ui. Can you suggest any solution, how to use it all and not dublicate the hole plugin code?
Just declare your functions in the global scope and then call them in the right places.
Yep, I guess that is the only way. Thank you once again.