Skip to main content
Solved

How to rerun the plugin without UI

  • January 31, 2025
  • 1 reply
  • 53 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__);

 

View original

tank666
  • 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__);

 


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