Figmation Commander icon

Figmation Commander

Send design object creation commands to the Figma plugin

Figmation Commander

AI-generated

Overview

The Figmation Commander node sends design object creation and manipulation commands to a Figma plugin via a WebSocket connection. It supports a wide range of commands such as creating shapes, frames, text, moving or resizing nodes, setting colors, exporting images, and more. This node is useful for automating design workflows in Figma by programmatically controlling design elements through WebSocket communication with the Figma plugin. For example, it can create a rectangle at a specified position, change the fill color of a node, or export a node as an image.

Use Case Examples

  1. Automate creation of design elements like rectangles, frames, and text in Figma.
  2. Batch update properties of multiple nodes such as colors, sizes, and positions.
  3. Export design nodes as images in various formats (PNG, JPG, SVG).
  4. Retrieve information about the current document, selected nodes, or available channels for communication.

Properties

Name Meaning
Server Port WebSocket server port (localhost only) used to connect to the Figma plugin.
Channel ID Target channel ID for WebSocket communication with the Figma plugin.
Command The specific Figma command to execute, such as creating shapes, moving nodes, or getting document info.

Output

JSON

  • command - The executed Figma command.
  • channelId - The channel ID used for communication.
  • host - The WebSocket host (localhost).
  • port - The WebSocket server port.
  • parameters - Parameters sent with the command.
  • result - Result returned from the Figma plugin after command execution.
  • timestamp - Timestamp of the command execution.
  • success - Indicates if the command was successful.
  • error - Error message if the command failed.
  • errorType - Type of error if the command failed.

Dependencies

  • A WebSocket server running locally to communicate with the Figma plugin.

Troubleshooting

  • Ensure the WebSocket server is running on the specified localhost port before executing commands.
  • Verify the Channel ID is provided for commands other than 'get_channels', as it is required for communication.
  • Common errors include connection errors if the WebSocket server is unreachable, timeout errors if the server does not respond in time, and channel errors if the channel ID is invalid or missing.

Discussion