grafta
v0.7.0Talk to any Figma file with your AI: ask what's in it, change it, or turn it into code.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
open_file
Open a Figma .fig file and keep it open for later calls. Returns a handle and a summary: pages, node counts, components, variable collections, images. Opening a path that is already open returns the same handle without reading it again. Large files take seconds to open; every later call on the handle is fast. Edits the file had not saved when grafta last stopped are replayed, and `recovered` says how many; edits all saved to another file are not, and it says which file.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to a .fig file. |
recover | boolean | Replay edits this file had not saved when grafta last stopped. Default true; false discards them. |
new_file
Create a new, empty .fig at a path that does not exist, and open it: one page and nothing else. `from` is any .fig you have; only its format is used (Figma's schema, which grafta does not invent), none of its content: no pages, components, styles, variables or images. Returns the handle, as open_file does.
| Parameter | Type | Description |
|---|---|---|
from * | string | Any .fig, whose format the new file uses. |
path * | string | A new path ending in .fig. |
page | string | The page's name. Default "Page 1". |
close_file
Close an open file and free the memory it holds. Edits not saved with save_as are discarded, for good: they are not recovered on the next open. The result says how many there were.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
list_open
List the files currently open, with their handles, node counts, unsaved edits, how long each took to open, and the process's memory; and the files open in Figma with grafta's panel on them, `in: "Figma"`, by handle and name, each with the page the person is on and what they have selected.
summarize
Overview of an open file: every page with its id, node count and number of top-level frames, plus totals for nodes, components, component sets, instances, text nodes, variables, styles and images, and the prototype's flows and live interactions.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
list_screens
The screens of a page, as a person sees them in Figma, in their order: a page's top-level frames, components, sections and other layers; a deck's slides, across its rows; a site page's breakpoints. Each with id, name, type, size and whether it is visible, ready for render_node. Paged.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
page * | string | A page's id, from summarize. |
budget | integer | Maximum result size in bytes. Default 32768. |
cursor | string | next_cursor from the previous page. |
limit | integer | Results per page. |
search_nodes
Find nodes by name (case-insensitive substring), by type (FRAME, TEXT, INSTANCE, COMPONENT, COMPONENT_SET, PAGE, SECTION, GROUP, RECTANGLE, VECTOR, …), by what a text layer says, by a style or variable a layer uses (by name, its own or a run of its text's), or by the component an instance is of (its id, or its component's or set's name). Every criterion given must match; names and text match as case-insensitive substrings. Optionally only inside one node. Returns id, name, type and the path from the page, in document order, paged. Hidden nodes are included.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
budget | integer | Maximum result size in bytes. Default 32768. |
component | string | Instances of this component: its id, or a case-insensitive substring of its name or its component set's name. |
cursor | string | next_cursor from the previous page. |
limit | integer | Results per page. |
name | string | Case-insensitive substring of the node name. |
style | string | Case-insensitive substring of the name of a fill, stroke, text or effect style the layer uses, or a run of its text. |
text | string | Case-insensitive substring of a text layer's characters. |
type | string | Node type, in the plugin API's spelling. |
variable | string | Case-insensitive substring of the name of a variable the layer binds, in any field or paint, or a run of its text. |
within | string | Only search inside this node id (a page, a frame…). |
read_node
Read one node exactly, in Figma's terms: geometry, fills/strokes (hex colours, bound variable names), effects, corner radii, auto-layout, constraints, text and its style, and for an instance its component and variant. A layer's prototype is `reactions` (trigger, actions, destination, transition), as the plugin API names them; a page gives its `flowStartingPoints`, a frame `overflowDirection` and overlay settings. Children to `depth` (default 1). Properties at Figma's default are left out: visible true, opacity 1, rotation 0, no fills/strokes/effects, radius 0, no auto-layout, constraints MIN/M…
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | Node id, e.g. 12:345. |
budget | integer | Maximum result size in bytes. Default 32768. |
children_from | integer | Skip this many children of the node: to resume a result cut for budget. |
depth | integer | Levels of children to include. 0 = the node alone. Default 1. |
geometry | boolean | Include vector path data (SVG d strings). Default false. |
read_raw
The node exactly as the file stores it: every field of its node change, including the ones read_node does not model (listed there as `undecoded`). Byte fields are shown as their length and a fingerprint.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | Node id, e.g. 12:345. |
budget | integer | |
fields | array | Only these top-level fields. Default: all. |
list_components
The components this file defines: every component set (with its variant properties and their values) and every standalone component, with id, name, page, component property definitions and how many instances use it. Variants inside a set are not listed separately; read_node on the set lists them as children. Paged.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
budget | integer | Maximum result size in bytes. Default 32768. |
cursor | string | next_cursor from the previous page. |
limit | integer | Results per page. |
name | string | Only components whose name contains this (case-insensitive). |
component_instances
Where a component is used: every instance of it (of any variant, for a component set), with id, name and path. Paged.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | A component or component set id. |
budget | integer | Maximum result size in bytes. Default 32768. |
cursor | string | next_cursor from the previous page. |
limit | integer | Results per page. |
list_variables
The file's design variables (tokens): each collection with its modes, and each variable's type and value per mode. Colours are hex; an alias is shown as { alias: <variable name> }, not flattened. Paged over variables.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
budget | integer | Maximum result size in bytes. Default 32768. |
collection | string | Only this collection (name or id). |
cursor | string | next_cursor from the previous page. |
limit | integer | Results per page. |
export_tokens
Write the file's variables as W3C Design Tokens (DTCG 2025.10) JSON, one NEW file per collection and mode, the way Figma imports them: <dir>/<collection>.<mode>.tokens.json. Names split on / into groups; colours exact from the file (sRGB components and alpha, hex beside); numbers without an invented unit; an alias within its collection as a {group.token} reference, to another collection as its value with Figma's com.figma.aliasData. Lists what was not written (unresolved), every name changed to fit the format (renamed), and notes. The folder must exist; no file is written over.
| Parameter | Type | Description |
|---|---|---|
dir * | string | An existing folder for the token files. |
handle * | string | The handle open_file returned. |
collection | string | Only this collection (name or id); all when left out. |
create_variable_collection
Make a variable collection (a set of design tokens) with named modes, e.g. modes: ["Light", "Dark"]. Then create_variable adds variables to it, and set_properties binds a fill to one by name. In a file with no Internal Only Canvas (one from new_file), grafta writes one first, where Figma keeps variables.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
modes * | array | Mode names, in order. |
name * | string | The collection's name, e.g. "Colors". |
create_variable
Add a variable to a collection, with a value for every mode: { "Light": "#7C3AED", "Dark": "#A78BFA" }. type is COLOR, FLOAT, STRING or BOOLEAN. A value may be { alias: <variable name or id> }, another local variable of the same type, as semantic tokens alias primitive ones. A COLOR variable can be bound at once with set_properties, fills: [{ type: SOLID, variable: <name> }].
| Parameter | Type | Description |
|---|---|---|
collection * | string | A collection's name or id. |
handle * | string | The handle open_file returned. |
name * | string | e.g. "Brand/Primary"; slashes group it in Figma's panel. |
type * | ||
values * | object | Mode name → value: "#RRGGBB" or "#RRGGBBAA" for COLOR, a number for FLOAT, a string for STRING, true or false for BOOLEAN, or { "alias": "<variable name or id>" } for another local variable of the s… |
set_variable
Change a variable grafta made: rename it, or change its value in the modes named (the others keep theirs). Values are as create_variable takes them, aliases included. Every fill bound to it follows, and a text whose size it binds is estimated again (texts_resized). The file's own variables are refused.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | A variable's id, or its name when only one has it. |
name | string | |
values | object | Mode name → value: "#RRGGBB" or "#RRGGBBAA" for COLOR, a number for FLOAT, a string for STRING, true or false for BOOLEAN, or { "alias": "<variable name or id>" } for another local variable of the s… |
set_variable_collection
Change a collection grafta made: rename it, or add a mode (add_mode: "High contrast"). In a new mode every variable takes its value in the first mode, to change with set_variable. The file's own collections are refused.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | A collection's id or name. |
add_mode | string | |
name | string |
list_styles
The file's own colour, text and effect styles, with their values: paints in hex, a text style's font, size, line height and letter spacing, effects. Styles removed from the file and a library's are left out. Apply one with set_properties: fillStyle, strokeStyle, effectStyle or textStyle.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
type |
create_style
Make a style: type FILL with fills (paints, as set_properties takes them), TEXT with fontFamily, fontStyle, fontSize, lineHeight and letterSpacing, or EFFECT with effects. Figma lists it under Local styles. Apply it with set_properties: fillStyle or strokeStyle for a FILL style, effectStyle, textStyle.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
name * | string | e.g. "Brand/Primary"; slashes group it. |
type * | ||
effects | array | EFFECT: shadows and blurs, as set_properties takes them. |
fills | array | FILL: paints, as set_properties takes them. |
fontFamily | string | |
fontSize | number | |
fontStyle | string | e.g. "Bold", "Semi Bold". |
letterSpacing | Pixels, or { value, unit: PIXELS | PERCENT }. | |
lineHeight | Pixels, { value, unit: PIXELS | PERCENT } or { unit: AUTO }. |
set_style
Change a colour, text or effect style, grafta's or one the file already has (a kit's brand colour, changed once): rename it, or change its values (as create_style takes them for its type). Every node using it follows, in Figma and in read_node, instances are derived again, and a text style's texts are estimated again (texts_resized). Library styles are refused.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | A style's id, or its name when only one has it. |
effects | array | EFFECT: shadows and blurs, as set_properties takes them. |
fills | array | FILL: paints, as set_properties takes them. |
fontFamily | string | |
fontSize | number | |
fontStyle | string | e.g. "Bold", "Semi Bold". |
letterSpacing | Pixels, or { value, unit: PIXELS | PERCENT }. | |
lineHeight | Pixels, { value, unit: PIXELS | PERCENT } or { unit: AUTO }. | |
name | string |
get_image
An image the file embeds, by the imageHash a fill carries (read_node shows it). Returned as an image, up to 4 MB; a larger one is described instead.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
hash * | string | The fill's imageHash. |
render_node
Draw a node (a board, frame, component, instance, shape or text) as a PNG you can look at, from the open file including unsaved edits. Use it to see a screen you read, or to check a change before save_as. Drawn offline: the caption's `notes` name everything drawn approximately or left out, and an empty list means nothing was.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | Node id, e.g. 12:345. |
max_size | integer | Largest side in pixels; a larger picture is scaled down to fit. Default 2048. |
scale | number | Pixels per unit. Default 1. |
export_pdf
Write nodes (frames, boards, components) to a NEW .pdf file, a page each in the order given, each page the node's size in points: screens for review or handoff. Each page is the drawing render_node makes, unsaved edits and modes included, as vectors, with text grafta wrote kept as selectable text. The result's `pages` give each page's notes, as render_node's do; a shadow or blur makes what it covers an image. Never overwrites.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
ids * | array | Node ids, one page each, in order. |
path * | string | A new path ending in .pdf. |
check_contrast
Check every visible text under a node (a screen, a frame, a component) against WCAG 2.2 AA: its colour against what is actually drawn behind it, as render_node draws it, in the frame's mode and with instances' overrides. 4.5:1 is required, 3:1 for large text (24 px, or 18.66 px bold). Lists the texts that fail, with colour, background, ratio and what is required, and those that cannot be measured, with why; `all: true` lists the passing ones too. Over a background of several colours, the lowest ratio is given. Paged.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | The node whose texts are checked. |
all | boolean | List passing texts too. Default false. |
budget | integer | Maximum result size in bytes. Default 32768. |
cursor | string | next_cursor from the previous page. |
limit | integer | Results per page. |
create_page
Create a page at the end of the file's page list. Returns its id. Nothing is written to disk until save_as.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
name * | string |
create_frame
Create an empty frame (no fill, no auto-layout) on a page or inside a frame, at x,y relative to the parent, with a width and height. Returns its id. Fills, strokes, auto-layout and text are not available yet: they have not been measured in Figma.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
height * | number | |
name * | string | |
parent * | string | A page or frame id. |
width * | number | |
x | number | |
y | number |
create_instance
Create an instance of a component this file defines, on a page or inside a frame, at x,y relative to the parent. It takes the component's own size. For a component set, pass one variant's id (the set's children, via read_node). Components from another file cannot be instantiated yet.
| Parameter | Type | Description |
|---|---|---|
component * | string | A component (or variant) id. |
handle * | string | The handle open_file returned. |
parent * | string | A page or frame id. |
name | string | Default: the component's name. |
x | number | |
y | number |
create_component
Turn a frame into a component, in place, keeping its children, so it can be reused: then place copies with create_instance (component: its id) and change what each copy shows with override_instance. Build the frame first (create_frame, create_text, create_vector, set_properties), then make it a component. A frame inside a component or an instance cannot be one.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | The frame to turn into a component. |
name | string | A new name, e.g. "Button/Primary". |
create_variant_set
Group components into a variant set, as Figma's own sets: one component with properties, each component a variant of it. variants: [{ id, values: { "State": "Default" } }], every variant naming the same properties with a different combination. The components must share a parent; the set is placed around them. Then create_instance with any variant's id, and set_variant to switch an instance.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
name * | string | The set's name, e.g. "Product row". |
variants * | array |
set_variant
Switch an instance of a variant to another variant of its set, by the values that change: { "State": "Substitute" }. The other properties keep their values. Its overrides stay; Figma matches them to the new variant's layers.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | An instance of a variant. |
values * | object | Property name → the value to switch to. |
add_component_property
Give a component a property its instances set: TEXT (a label), BOOLEAN (show a part or not) or INSTANCE_SWAP (which icon), with its default. Then bind a layer inside the component with set_properties componentPropertyReferences ({ characters | visible | mainComponent: <property> }), and set each instance's value with set_properties componentProperties ({ "Label": "Guardar" }).
| Parameter | Type | Description |
|---|---|---|
component * | string | A component's id. |
default * | A string, true or false, or a component's name or id. | |
handle * | string | The handle open_file returned. |
name * | string | e.g. "Label", "Show icon". |
type * |
create_text
Create a text layer on a page or in a frame. characters is the text (a line break starts a new paragraph). fontFamily and fontStyle name a font as Figma does (e.g. "Inter", "Semi Bold"); by default, the file's most used font. fontSize, fills (like set_properties: SOLID colour or a local colour variable; default black), x, y, textAlignHorizontal (LEFT, CENTER, RIGHT, JUSTIFIED), lineHeight (pixels, { value, unit: PIXELS | PERCENT } or { unit: AUTO }; default Auto, or the file's usual one at that size), letterSpacing (pixels or { value, unit: PIXELS | PERCENT }). Give width to wrap text inside a…
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
parent * | string | A page or frame id. |
characters | string | |
fills | array | |
fontFamily | string | |
fontSize | number | |
fontStyle | string | |
height | number | |
letterSpacing | ||
lineHeight | ||
name | string | Layer name. Default: the characters. |
paragraphIndent | number | |
paragraphSpacing | number | |
paragraphs | array | |
runs | array | The text as styled pieces; instead of characters. |
textAlignHorizontal | ||
textAlignVertical | ||
textAutoResize | ||
textCase | ||
textDecoration | ||
width | number | |
x | number | |
y | number |
create_vector
Draw a vector from SVG path data (M L H V C S Q T A Z), as icon sets publish it: Lucide, Heroicons, Material Symbols. `path` is one path's d, or a list of them. `viewBox` is the box the data is drawn in ([0, 0, 24, 24] for Lucide), scaled to width and height; without it, the path's own bounds. For a line icon give strokes, strokeWeight (in the vector's pixels: Lucide's 2 at 24 px is 4 at 48 px), strokeCap and strokeJoin ROUND, and no fills. Figma draws the geometry itself.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
parent * | string | A page or frame id. |
path * | SVG path data: a string, or a list of strings drawn together. | |
fillRule | ||
fills | array | |
height | number | |
name | string | |
strokeCap | ||
strokeJoin | ||
strokeWeight | number | |
strokes | array | |
viewBox | array | [min x, min y, width, height] of the box the path is drawn in. |
width | number | |
x | number | |
y | number |
create_shape
Draw a shape as Figma's own layer type: RECTANGLE (cornerRadius), ELLIPSE (arcData { startingAngle, endingAngle, innerRadius } in radians: a ring, a pie, a half arc), LINE (width is its length; needs strokes), POLYGON (pointCount sides) or STAR (pointCount points, innerRadius 0-1). Fills and strokes as set_properties takes them; nothing is painted unless named. Style it further with set_properties.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
parent * | string | A page or frame id. |
type * | ||
width * | number | |
arcData | object | |
cornerRadius | number | |
fills | array | |
height | number | Not for a LINE. |
innerRadius | number | |
name | string | |
pointCount | integer | |
strokeWeight | number | |
strokes | array | |
x | number | |
y | number |
override_instance
Change what an instance shows, without changing its component: the colour of an icon, a button's label, a hidden part. properties: fills and strokes (paints, as in set_properties), characters (text layers), visible. layer names the component's layer by its id, as read_node on the component shows it; for a layer inside a nested instance, give a path of ids [nested instance, layer]. Without layer, fills and strokes recolour every vector layer of the component that already has fills (or strokes), and never add paint to a layer that had none. Many icons are drawn with strokes, not fills: read_node…
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | An instance you created. |
properties * | object | |
layer | A layer id in the component, or a path of ids through nested instances. |
fill_template
Place a component once per row of data, in a page or frame (an auto-layout frame flows them): product cards, list rows, localised screens. Rows are a JSON array of objects, or a CSV file whose first line names the keys. Each key of a row is, in this order: `name` (the instance's layer name); a variant property, when `component` is a variant set; a component property (TEXT, BOOLEAN, INSTANCE_SWAP); or the name of a layer in the component, whose text it sets, or whose image when the value is a .png or .jpg path. Any other key refuses the call before anything is written. One call, up to 1000 rows…
| Parameter | Type | Description |
|---|---|---|
component * | string | A component, or a variant set. |
handle * | string | The handle open_file returned. |
parent * | string | A page or frame id. |
csv | string | A CSV file instead of rows: its first line names the keys. |
rows | array | One object per instance. |
import_layout
Write a web page's layout as design layers: a layout snapshot (JSON from grafta's snapshot.js, https://n0ss4.github.io/grafta/snapshot.js, run in a browser on the page: graftaSnapshot('<css selector>')) becomes frames, text, images and auto-layout in a page or frame. Flexbox becomes auto-layout with fill, hug or fixed sizing as the browser measured it (layout: "auto", the default), or every box is placed where the browser put it ("absolute"). Backgrounds, uniform borders, radii, box shadows, opacity, fonts and local or data: images are written; what is not (a gradient, a transform, an inline S…
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
parent * | string | A page or frame id. |
snapshot * | string | The snapshot's JSON file. |
layout | string | Flexbox as auto-layout (default), or every box where the browser put it. |
x | number | |
y | number |
set_properties
Change a frame, instance or text layer you created, using read_node's names: x, y, width, height, name, visible, clipsContent (clip children to the frame), auto-layout (layoutMode NONE | HORIZONTAL | VERTICAL, itemSpacing, counterAxisSpacing, padding or paddingTop/Right/Bottom/Left, primaryAxisSizingMode and counterAxisSizingMode FIXED | AUTO (a frame given layoutMode alone hugs its children along that axis, as in Figma: give primaryAxisSizingMode FIXED to keep its size), primaryAxisAlignItems MIN | CENTER | MAX | SPACE_BETWEEN, counterAxisAlignItems MIN | CENTER | MAX, layoutWrap), a child's…
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | A frame, instance or text layer you created. |
properties * | object |
move_node
Move a frame, component or component set, instance, text layer, shape or vector: into another page or frame, or among its siblings. Siblings are drawn in order, the last on top; in an auto-layout frame the order is also the flow. Give `parent` (with `to`: "front", the default, or "back"), or `behind` / `in_front_of` a sibling to go right behind or in front of it, in that sibling's parent. x,y are relative to the new parent; by default the node keeps them.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | |
behind | string | A node to go right behind, in its parent. |
in_front_of | string | A node to go right in front of, in its parent. |
parent | string | A page or frame id. |
to | string | With parent: the top of the stack (last, the default) or the bottom (first). |
x | number | |
y | number |
delete_node
Delete a node (a page, frame, text or instance) and everything inside it. Returns the ids removed. Refused when another node points at it or at something inside it (an instance of a component in it, a prototype link to it, an override of one of its layers), naming who. A layer inside a component goes from every instance of it, unless an instance overrides it. `also` deletes more nodes in the same call: what they point at among themselves does not count, so components that use each other can go together.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | |
also | array | More nodes deleted with it, in one call. |
group_nodes
Group layers that share a parent, as Figma's Group: the group sits at their bounds and each layer keeps its place on the canvas. Moving or resizing a grouped layer with set_properties fits the group again. ungroup undoes it.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
ids * | array | |
name | string | Default "Group". |
ungroup
Ungroup a group: its layers go to the group's parent, in its place and order, each where it was on the canvas, and the group is removed.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | A group's id. |
create_section
Make a section on a page, to organise screens ("Onboarding", "Checkout"). Then move frames into it with move_node (parent: the section), or create them in it.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
height * | number | |
parent * | string | A page's id. |
width * | number | |
name | string | |
x | number | |
y | number |
duplicate_node
Duplicate a node with everything in it: every layer copied with a new id, instances still instances of their components, bindings and styles kept. The copy goes in the same parent unless one is named, at x, y (by default the original's), in front of its new siblings; then change it. A component, or anything holding one, is not duplicated.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
id * | string | |
name | string | |
parent | string | Where the copy goes; by default the original's parent. |
x | number | |
y | number |
save_as
Write the open file, with its edits, to a NEW path ending in its product's extension: .fig, or .deck for a Figma Slides file, .jam for FigJam, .site for Figma Sites. Never overwrites: a path that exists, or the source file, is refused. The written file is read back and compared before success is reported. Open the result in Figma to see it.
| Parameter | Type | Description |
|---|---|---|
handle * | string | The handle open_file returned. |
path * | string | A new path ending in .fig, or .deck, .jam or .site for a Figma Slides, FigJam or Figma Sites file. |