Skip to main content
Solved

Can you check whether or not you are in a FigJam file?


Erica_Luzzi

I am building a plugin that works in both Figma and FigJam files. My plugin pastes text to the document, and I’d like to be able to determine which file type I’m in so that I can have the plugin post either a sticky note or a frame.

I can’t find anything in the documentation on how to do this. Does anyone know how to help? Thank you!

Best answer by ntfromchicago

Hi Erica! Welcome to Figma plugin development.

In your code, check for editorType and branch accordingly:

if (figma.editorType === "figjam") {
  // make a sticky
} else if (figma.editorType === "figma") {
  // make a frame
}

Link for more info: Setting editor type · Figma Plugins

P.S. – I also moved your question to the plugin API section of the forum.

View original
This topic has been closed for comments

5 replies

ntfromchicago
  • New Member
  • 287 replies
  • Answer
  • April 8, 2022

Hi Erica! Welcome to Figma plugin development.

In your code, check for editorType and branch accordingly:

if (figma.editorType === "figjam") {
  // make a sticky
} else if (figma.editorType === "figma") {
  // make a frame
}

Link for more info: Setting editor type · Figma Plugins

P.S. – I also moved your question to the plugin API section of the forum.


Erica_Luzzi

Thank you so much! Sorry about the incorrect categorization. Using the editorType attribute has led to a new error:
code.ts:67:30 - error TS2304: Cannot find name ‘figjam’.

I checked my manifest.json file, and I have figjam listed as an editorType:
“editorType”: [
“figma”, “figjam”
]

I went into Figma and did “import plugin from manifest” to try and see if the manifest was somehow not linked to my plugin, but I got a message saying my plugin was already imported. Do you have suggestions for how to debug this?

I can also move this to a new forum post if that is better etiquette - just lmk. Thank you so much!


ntfromchicago

Sorry! My code share might have been incorrect. Make sure "figma" and "figjam" are in quotes. (I edited my post above).

We can continue the troubleshooting conversation here, even if the topic changes =).


Erica_Luzzi

thank you so much! that worked perfectly 🙂


  • 0 replies
  • May 8, 2022

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


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