Advertisement
Guest User

Untitled

a guest
Jul 1st, 2024
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Rename the first page
  2. figma.root.children[0].name = '✅ [JIRA-TICKET] Handover ready'
  3.  
  4. let pages: Array<string> = [
  5.   '🚧 [JIRA-TICKET] Handover WIP',
  6.   '---',
  7.   '🚀 Exploration',
  8.   '💙 Showcase',
  9.   '⚛️ Components',
  10.   '⚰️ Graveyard',
  11.   '🌠 Cover'
  12. ]
  13.  
  14. // Get the names of the existing pages
  15. let existingPageNames = []
  16. for (let node in figma.root.children) {
  17.   existingPageNames.push(figma.root.children[node].name)
  18. }
  19.  
  20. // Create the page if a page with a same name doesn't exist already
  21. for (let i in pages) {
  22.   if(!existingPageNames.includes(pages[i])) {
  23.     let page = figma.createPage()
  24.     page.name = pages[i]
  25.   }
  26. }
  27.  
  28. // Notify and close the plugin
  29. figma.closePlugin('✨ Pages created ✨')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement