Skip to content

Instantly share code, notes, and snippets.

@gavinmcfarland
Last active March 2, 2021 10:58
Show Gist options
  • Save gavinmcfarland/76446110f1482b570e93a7554de58a72 to your computer and use it in GitHub Desktop.
Save gavinmcfarland/76446110f1482b570e93a7554de58a72 to your computer and use it in GitHub Desktop.
A helper to get list of page names in a Figma document
function getPageNames() {
var names: any = []
var pages = figma.root.findAll((node) => {
if (node.type === "PAGE") {
names.push(node.name)
}
return (node.type === "PAGE")
})
return names
}
print (getPageNames().join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment