Exporting to PNG, Spaces becomes Hyphen?
Hello!
I have this beautiful function that export layers and stuf to PNG-files. It works great exept one thing. If i spaces in the filename it will convert the spaces to hyphen!
For example. If i am working with C:\users\Clint\Clint Eastwood is so beautiful.ai. The script puts a file named Clint-Eastwood-is-so-beautiful.png in the folder C:\users\Clint.
Why oh why the Hyphens?? I dont want them ![]()
Any one have a good idea?
fullPath= app.activeDocument.fullName.parent;
docName = app.activeDocument.name.match(/^.*[^.ai]/i);
exportFileToPNG24(fullPath + "\\" + docName + ".png");
function exportFileToPNG24 (dest) {
if ( app.documents.length > 0 ) {
var exportOptions = new ExportOptionsPNG24();
var type = ExportType.PNG24;
var fileSpec = new File(dest);
alert(dest);
exportOptions.antiAliasing = false;
exportOptions.transparency = true;
exportOptions.saveAsHTML = false;
exportOptions.horizontalScale = 100;
exportOptions.verticalScale = 100;
app.activeDocument.exportFile( fileSpec, type, exportOptions );
}
}
// Mr Clint
