Figma Support Forum

Export and Save as SVG File

I am trying to export and save an SVG file from “Run Once” Plugin (No UI/Browser APIs).

I have tried exportAsync in following code which is returning svg code, but how i can save it as svg file.

`let node = figma.currentPage.selection[0];
node.exportAsync({format: ‘SVG’}).then(res => console.log(String.fromCharCode.apply(null, res))).catch(err => console.error(err));

figma.closePlugin();`

Please help :slightly_smiling_face:

1 Like