How do I append a sub-directory in my save as script?
I have a script I've made that saves images with a custom extension, currently it saves it as a copy in the source directory. I want to append a sub-directory for the copy to be saved in when it's complete. Here is my script:
#target photoshop
main();
function main(){
if(!documents.length) return;
try{
var Path= activeDocument.path;
}catch(e){var Path = "~/desktop";}
var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');
var saveFile= new File(Path + "/Maps" + Name + ".map.png");
sfwPNG24(saveFile);
}
function sfwPNG24(saveFile){
var pngOpts = new PNGSaveOptions;
pngOpts.compression = 9;
pngOpts.interlaced = true;
activeDocument.saveAs(saveFile, pngOpts, true, Extension.LOWERCASE);
}
I believe this is determined on line ten. I have already tried using `/Maps` but it does not work. Is this possible? If so, how can I get this to work in my script?
