Skip to content

Instantly share code, notes, and snippets.

@kemiljk
Last active March 31, 2021 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kemiljk/e7a76fbdcc39ebe578bc50bea224d744 to your computer and use it in GitHub Desktop.
Save kemiljk/e7a76fbdcc39ebe578bc50bea224d744 to your computer and use it in GitHub Desktop.
A quick way to grab all instances that match your selection for easy switching
let iconName: String
let getInstances
const { selection } = figma.currentPage
function getInstanceByName(node) {
iconName = selection[0].name
}
getInstanceByName(selection)
getInstances = figma.currentPage.findAll(isInstance).filter((node) => node.name === iconName);
figma.currentPage.selection = getInstances
figma.notify(`${getInstances.length} ${iconName}'s selected`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment