Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Rename the first page
- figma.root.children[0].name = '✅ [JIRA-TICKET] Handover ready'
- let pages: Array<string> = [
- '🚧 [JIRA-TICKET] Handover WIP',
- '---',
- '🚀 Exploration',
- '💙 Showcase',
- '⚛️ Components',
- '⚰️ Graveyard',
- '🌠 Cover'
- ]
- // Get the names of the existing pages
- let existingPageNames = []
- for (let node in figma.root.children) {
- existingPageNames.push(figma.root.children[node].name)
- }
- // Create the page if a page with a same name doesn't exist already
- for (let i in pages) {
- if(!existingPageNames.includes(pages[i])) {
- let page = figma.createPage()
- page.name = pages[i]
- }
- }
- // Notify and close the plugin
- figma.closePlugin('✨ Pages created ✨')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement