Auto save implementation for AdobeXD

i’m ali.
i need to write plugin for auto-saving for adobe xd.
i think good way to implement auto-saving is running Save method each 5 seconds.
and here i have two problems:

  1. how can i run a function each 5 second
  2. how can i save a document?(in local file and cloud)
    maybe if i know how to run built-in methods (save method) or how to run keyboard shortcuts, i can solve second problem.
    thank you in advance for your reply

There is no plugin APIs to save the document. If it is a cloud document, all changes are already automatically saved by XD after a few seconds of user inactivity. This happens even if not currently connected to the Internet.

While it is possible to run a function on a schedule using setInterval(), this is in general not something that plugins should do. A plugin usually edits the current document in response to the user explicitly running it. There are edit context rules to ensure that plugins do not make changes without user interaction.

1 Like