Skip to main content
Question

Export multiple frames to file system with exportAsync()

  • February 1, 2022
  • 5 replies
  • 1869 views

Tom21

I understand how to use exportAsync() to create a Uint8Array that I can send back to ui.html to trigger a single download.

Does someone have an example of exporting multiple frames? The behavior would be the same as exporting multiple frames within the Figma app.

This topic has been closed for replies.

5 replies

Erwin_Goossen

I’m currently working on a plugin for exporting a whole bunch of images once. I use jsZip for creating a zip file with all the images in there in the correct file structure. This way you end up with 1 single file you could trigger to download


Nidhin_Kuttikkattu_Rajeevan

Is there any example on this thread please?


Zaydek
  • 3 replies
  • February 1, 2024

It’s pretty straight forward with JSZip. It only has a few APIs and then you need to call a <a href download> on the result blob. This should help you get started. ChatGPT.


Luis_Abaladas

Hey @Zaydek !

Sorry for the bump on this old topic — but is there any way you could provide that link again, it’s currently broken, and it might have the solution for my problem 😀


Zaydek
  • 3 replies
  • March 21, 2024

@Luis_Abaladas Sorry for the dead link but yeah the process is more or less the following. You call exportAsync multiple times, building up some kind of data structure like an array, then you simply send the to the UI thread (you don’t have to preprocess it in the Figma thread). Once it’s in the UI thread, you can base64 or download it as a blob using JSZip.

Feel free to DM me on Twitter or Discord if you need, can find me here https://twitter.com/username_ZAYDEK.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings