const numberOfShapes = 5 ; const nodes = [ ] ; for ( let i = 0 ; i < numberOfShapes ; i ++ ) { const shape = figma . createShapeWithText ( ) ; shape . shapeType = 'ROUNDED_RECTANGLE' ; shape . x = i * 400 ; shape . fills = [ { type : 'SOLID' , color : { r : 1 , g : 0.5 , b : 0 } } ] ; figma . currentPage . appendChild ( shape ) ; nodes . push ( shape ) ; } ; for ( let i = 0 ; i < ( numberOfShapes - 1 ) ; i ++ ) { const connector = figma . createConnector ( ) ; const strokeWeight = { ... connector . strokeWeight } ; connector . strokeWeight = 8 ; connector . connectorStart = { endpointNodeId : nodes [ i ] . id , magnet : 'AUTO' , } ; connector . connectorEnd = { endpointNodeId : nodes [ i + 1 ] . id , magnet : 'AUTO' , } ; } ; figma . currentPage . selection = nodes ; figma . viewport . scrollAndZoomIntoView ( nodes ) ; figma . closePlugin ( ) ;