Complete the code to select a frame by its name in Figma plugin API.
const frame = figma.currentPage.[1](node => node.name === 'Frame 1');
The findOne method returns the first node matching the condition, which is used to find a frame by name.
Complete the code to navigate the viewport to the selected frame.
figma.viewport.[1](frame);The scrollAndZoomIntoView method moves the viewport to show the specified node.
Fix the error in the code to correctly find a frame named 'Dashboard'.
const dashboard = figma.currentPage.[1](node => node.name === 'Dashboard' && node.type === 'FRAME');
findOne returns the first node matching the condition, which is correct here. findAll returns an array, and filter is not a method on currentPage.
Fill both blanks to select a frame named 'Settings' and navigate the viewport to it.
const settingsFrame = figma.currentPage.[1](node => node.name === 'Settings' && node.type === 'FRAME'); figma.viewport.[2](settingsFrame);
Use findOne to get the frame and scrollAndZoomIntoView to move the viewport.
Fill all three blanks to find a frame named 'Profile', check if it exists, and then navigate the viewport to it.
const profileFrame = figma.currentPage.[1](node => node.name === 'Profile' && node.type === 'FRAME'); if (profileFrame !== [2]) { figma.viewport.[3](profileFrame); }
Use findOne to find the frame, check against null to confirm it exists, then use scrollAndZoomIntoView to move the viewport.