Overview
Selects multiple nodes in Figma and adjusts the viewport to show all selected nodes. This is the batch version ofset_focus, allowing you to select and focus on multiple elements simultaneously.
Parameters
Array of node IDs to select. All nodes must exist in the current document.
Return Value
Returns information about all selected nodes:Usage Example
Behavior
When you callset_selections:
- All specified nodes are selected (previous selection is replaced)
- The viewport adjusts to show all selected nodes
- If nodes are far apart, the viewport zooms out to fit them all
Best Practices
Use
set_selections when you need to highlight multiple related elements, such as all instances of a component or all nodes matching a search criteria.Common Use Cases
- Selecting all results from a search operation
- Highlighting related elements (e.g., all buttons in a design)
- Selecting multiple nodes before a batch operation
- Demonstrating relationships between design elements
- Preparing nodes for manual editing by the user
Code Location
Source:server.ts:2493-2523
Related Tools
- set_focus - Focus on a single node
- get_selection - Get current selection
- scan_nodes_by_types - Find nodes to select