Export SVG of single artboard without appending text to filename?
I'm trying to export each artboard of an AI file as an SVG without including all of the artwork that's not on the current artboard.
I'm able to use the following settings to achieve this, but then the file name gets text appended during the save, and then i end up with an incorrect filename after the export.
for example, if i'm exporting an artboard called "my-special-artboard", the resulting file is called "my-special-artboard_my-special-artboard.svg".
Here's the svg export functions.
function setSvgOptions(abIndex)
{
var options = new ExportOptionsSVG();
options.preserveEditability = false;
options.saveMultipleArtboards = true;
options.artboardRange = "" + (abIndex + 1);
return options;
}
function saveSvg(doc, filePath, options, artboardIndex, artboardName)
{
var destFile = new File(filePath + "/" + artboardName + ".svg");
// var destFile = new File(filePath + "/" + ".svg");
doc.exportFile(destFile, ExportType.SVG, options);
}
//and the function call. x represents the active artboard index.
svgOptions = setSvgOptions(x);
saveSvg(docRef, curSvgFolder, svgOptions, x, curAbName);
I can fix the file name problem by removing "saveMultipleArtboards" and "artboardRange" from the exportOptions, but then the resulting SVG contains all the artwork from the other artboards.
Any ideas??
