Is there any way to run a plugin just before the document is saved? I would have expected a 'DocumentSaved.Begin' action to exist, but that doesn't seem to be the case. Or maybe it's named something else?? 😅 ('DocumentSaved.Begin' doesn't make much grammatical sense).
Some context, I'm working a plugin that changes improves some formatting of the document when it is saved. This seems like a pretty standard thing to do, most modern code editors now can autoformat code on save. However, the
DocumentSaved action only seems to run the plugin AFTER the save has happened which means any modifications that the plugin makes are not saved and the document is left in an 'unsaved changes' state immediately after saving.
I'm probably not the only one who's hit this. Does anyone know any workarounds?
( 😃A million thanks to the Sketch team for creating such an awesome product and supremely intuitive API. I wasn't expecting to be able to achieve a plugin with even a quarter of the functionality my plugin now has, it's incredible. The documentation and API are overall some of the best I've ever seen/used. 'Actions' seems to be a rough patch at the moment, but I'm sure that'll get improved! The functionality added there is completely brilliant.)