Skip to main content
Solved

How to rerun the plugin without UI

  • January 31, 2025
  • 1 reply
  • 121 views

elcicneha

I’ve used multiple plugins where after you run it the first time, there comes an option on the right sidebar to rerun the plugin, but this time it runs with the previous settings, without launching the UI. 

How can I add that functionality in my plugin?

Best answer by tank666

To add a relaunch button in Figma UI, you need to add a manifest.relaunchButtons array with commands, then use the plugin code to set it to some node using the setRelaunchData() method and write code for the relaunch button command handler.

For example:

manifest.json

{
"relaunchButtons": [
{
"command": "relaunch",
"name": "Relaunch"
}
],

}

code.js

figma.root.setRelaunchData({relaunch: ''});

if (figma.command === 'relaunch') {
// do something
}
else figma.showUI(__html__);

 

This topic has been closed for replies.

1 reply

tank666
  • 4873 replies
  • Answer
  • January 31, 2025

To add a relaunch button in Figma UI, you need to add a manifest.relaunchButtons array with commands, then use the plugin code to set it to some node using the setRelaunchData() method and write code for the relaunch button command handler.

For example:

manifest.json

{
"relaunchButtons": [
{
"command": "relaunch",
"name": "Relaunch"
}
],

}

code.js

figma.root.setRelaunchData({relaunch: ''});

if (figma.command === 'relaunch') {
// do something
}
else figma.showUI(__html__);