Triggered whenever the user exports some artboards, layers or slices.
The action context for this action contains two keys:
document: the document that the change occurred in. Note: currently, this is an instance of
MSImmutableDocumentData, and not the more usual
MSDocumentinstance. This is likely to be corrected in a future update of Sketch.
exports: a list of the items that were exported. Each entry in this list is a dictionary – see Exports List below for more details.
Each entry in the
exports property of the action context is a dictionary containing two keys:
MSExportRequestobject, which contains the details of the export, such as the scale, the format, whether trimming was enabled, and so on.
path: the path of the exported file on disc. Examining the file extension of this path is a quick way to filter out exports of a particular type (eg “.svg”).
For an example of this action, see the SVGO Export Plugin