I created a small plugin for creating Tables. I hope to create and access a small data Figma file in the community space to save the Table’s data styles that the table needs to use, and then how can I read the file?
In fact, this is a problem with reading files across files in Figma API. I wish any expert can enlight us, or give some clues and hints.
for example, can access it and clone it, but how to clone it? Which function I can use?
Here is the Screenshot, it is ugly because this plugin only can work but bounding one static Figma file, I hope it can work in any Figma file without any limitation
Plugins can only work within the limits of one file. The most you can do is import components from other files (libraries), and even then you have to know the component keys first, which you can’t get without opening the plugin in the library file first.
Could I know which function should I use to get the component keys? I have already hung up a Figma file with full edit permissions in a URL, and already put all resource frames into it.
Could you let me know where is the introduction of this function?
Edit permissions and URLs have nothing to do with plugins. Open the file, open the plugin in that file, scan the file for the component you need (using something like root.findAll for example) and then get the key via component.key property.
Hi, Tank, Thank you for reminding me of the “figma.” mistake I made, I fixed it, and it worked, but … there is some 404
So could you tell me some clue about the console error report?
Note that you are receiving a syntax error, not the plugin API error, which means your code is written incorrectly. Most likely you are trying to use await outside of an async function (or outside of any function for that matter). Make sure you are using async/await correctly.
Could you help me with more complete/Entire code, sorry I’m a noob designer and I’m really stupid at coding😂
I feel like I’m at the gate, but I just “can’t get in”: I just can’t import this component from the library.