I need a modification to this script to change the save as format
my goal is to have a script that saves as an Icon and close the document afterwards,
photoshop doesn’t support saving as Icon by default but using this plugin it gives me the option to do so (image has to be 8bit and no larger than 256×256)
Save as icon
I found the script below and it does most of what I want, except that it saves as png, I want to change that so it saves as an Icon.ico
and if possible, I want the script to also minimize photoshop after it’s finished.
main();
function main(){
if(!documents.length) return;
try{
var Path = decodeURI(activeDocument.path);
}catch(e){return;}
if(!Folder(Path).exists){
alert(Path + " Does not exist!");
return;
}
var Name = decodeURI(app.activeDocument.name).replace(/.[^.]+$/, '');
var saveFile = File(Path + "/" + Name + ".png");
sfwPNG24(saveFile);
//Uncomment the line below if you want to close the document.
//app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
function sfwPNG24(saveFile){
var pngOpts = new PNGSaveOptions;
pngOpts.compression = 9;
pngOpts.interlaced = false;
activeDocument.saveAs(saveFile, pngOpts, true, Extension.LOWERCASE);
}
I should mention that after choosing to save as an icon, the plugin pops up this “Choose icon format” box (I always use standard ICO) so this has to be addressed in the script
any help is appreciated, Thank you in advance.