Created
August 17, 2019 20:46
-
-
Save kostimarko/95f951eb3e7e2231cfeda7936cb9b84c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Work horse for exporting layers | |
function exportLayers(){ | |
for(var e = 0; e< doc.layers.length; e++){ | |
// Set the selected layer on | |
doc.layers[e].visible = true; | |
// Store layername | |
var layerName = doc.layers[e].name; | |
// Function returns a new file name | |
var targetFile = getNewName(layerName); | |
// Function returns SVG save options | |
svgSaveOpts = getSVGOptions(); | |
// Save SVG | |
doc.exportFile(targetFile,ExportType.SVG,svgSaveOpts); | |
// Turn selected layer off | |
doc.layers[e].visible = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment