Please excuse me…I’m not a professional developer. I’m trying to write a plugin that is able to find the export settings (set by the user in the app) of a component in a team library when I pull an instance. In the console, I get Iobject, Object] for mainComponent.exportSettings:
figma.on('selectionchange', async () => {
const selection = figma.currentPage.selection;
const instance = selectione0];
if(instance.type === "INSTANCE" && selection.length === 1){
const mainComponent = await instance.getMainComponentAsync();
if(mainComponent){
console.log("Main component: " + mainComponent.parent?.name);
console.log("Main component's export settings: " + mainComponent.exportSettings);
figma.closePlugin();
}
}
I’d really appreciate any help, especially if it’s accompanied by a good explanation (since, I’m trying to learn this stuff). Thanks!!!