Created
March 29, 2016 10:05
-
-
Save joonaspaakko/0d04dfcf434d5d9db75b to your computer and use it in GitHub Desktop.
Saves a file in Photoshop as jpg. File path is based on current document and filename is based on current layer.
This file contains 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
var doc = app.activeDocument; | |
var fileName = doc.activeLayer.name; | |
var outputLocation= File( doc.path + "/" + fileName ); | |
save( outputLocation ); | |
function save( outputLocation ) { | |
var saveOptions = new ExportOptionsSaveForWeb; | |
saveOptions.format = SaveDocumentType.JPEG; | |
saveOptions.optimized = true; | |
saveOptions.interlaced = true; | |
saveOptions.quality = 100; | |
doc.exportDocument( new File( outputLocation ), ExportType.SAVEFORWEB, saveOptions ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment