Copy link to clipboard
Copied
Can someone help me with fixing the error in script (in red text below)? I'm getting error as in the pic
// Prompt user for file name
var fileName = prompt("Enter file name (without extension):", "Untitled");
// Check if user canceled the prompt
if (fileName === null) {
alert("Saving canceled.");
} else {
// Save as SVG
var svgOptions = new ExportOptionsSVG();
svgOptions.embedRasterImages = true;
svgOptions.cssProperties = SVGCSSPropertyLocation.STYLEELEMENTS;
svgOptions.fontSubsetting = SVGFontSubsetting.None;
svgOptions.preserveEditability = true;
var svgFile = new File("C:\\temp\\" + fileName + ".svg");
app.activeDocument.exportFile(svgFile, ExportType.SVG, svgOptions);
// Save as WMF
var wmfOptions = new ExportOptionsWMF();
wmfOptions.resolution = 300;
var wmfFile = new File(fileName + ".wmf");
app.activeDocument.exportFile(wmfFile, ExportType.WMF, wmfOptions);
// Save as AI
var aiOptions = new IllustratorSaveOptions();
var aiFile = new File("C:\\temp\\" + fileName + ".ai");
app.activeDocument.saveAs(aiFile, aiOptions);
// Alert user that files are saved
alert("Files saved as C:\\temp\\" + fileName + ".svg and C:\\temp\\" + fileName + ".ai");
}
Copy link to clipboard
Copied
Hi @Padmaprasad36061084lyqa, as far as I can tell there is no scripting support for WMF format. (At least in AI 28.3)
- Mark
Copy link to clipboard
Copied
you could record an Action to epxort to WMF and have your script play the action