SketchAPI icon indicating copy to clipboard operation
SketchAPI copied to clipboard

APIs missing: Document Name

Open matteogratton opened this issue 3 years ago • 0 comments

The Sketch document name is not available in the current implementation.

The only way to find it is currently via:

var sketch = require("sketch");
var document = sketch.getSelectedDocument();
if (document.path) {
    documentName = normalizePaths(document.path.split("/").reverse()[0]);
    documentName = documentName.replace(".sketchcloud", "");
    documentName = documentName.replace(".sketch", "");
}

matteogratton avatar Jun 23 '22 10:06 matteogratton