Select all instances of a component in the entire file

Hi,

Is there any solution to select all instances of a component in the entire file, not only in a page?

Thanks! :slight_smile:

1 Like

You could use the Scripter plugin to do this. Here’s some sample code you can test out:

const instanceName = 'TEST' // Change this to the name of the instance you want to select
const pageArray = figma.root.children;

for (let i = 0; i < pageArray.length; i++) {
		const somePage = pageArray[i] as PageNode;
		const nodeArray = somePage.findAll(n => n.type === 'INSTANCE' && n.name === instanceName);
		somePage.selection = nodeArray;
}

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