Last active
December 30, 2021 16:22
-
-
Save branneman/b3d0daf03913112fc502326e7ea96183 to your computer and use it in GitHub Desktop.
Photoshop Script: Save an extra png on Document Save
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(); | |
function main(){ | |
var Name = app.activeDocument.name.replace(/\.[^\.]+$/, ''); | |
var Ext = decodeURI(app.activeDocument.name).replace(/^.*\./,''); | |
if(Ext.toLowerCase() != 'psd') return; | |
var Path = app.activeDocument.path; | |
var saveFile = File(Path + "/" + Name +".png"); | |
if(saveFile.exists) saveFile.remove(); | |
SavePNG(saveFile); | |
} | |
function SavePNG(saveFile){ | |
var pngSaveOptions = new PNGSaveOptions(); | |
activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment