-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebexport.jsx
More file actions
executable file
·42 lines (27 loc) · 1.06 KB
/
webexport.jsx
File metadata and controls
executable file
·42 lines (27 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* This is Javascript for Adobe Photoshop CS3 to export multiple images for web
*/
// Include the utilities
#include util.jsxinc
#include Progressor.jsxinc
// Set a script name
var scriptName={en:"export script (web)",de:"Export-Skript (Web)"};
// Saving options
var jpgOpts = new JPEGSaveOptions();
jpgOpts.embedColorProfile=true;
jpgOpts.quality=10; // high enough
var log='';
var fileList=File.openDialog(localize({en:"Choose files to export for web",de:"Wählen Sie Dateien zum exportieren für des Web"}),undefined,true);
if(fileList) {
// Porgress bar widget
var progressor = Progressor(scriptName);
for(var i=0;i<fileList.length && !progressor.isCancelRequested();i++) {
progressor.progress(i,fileList.length); // update progress bar
var doc=app.open(fileList[i]);
doc.flatten();
doc.resizeImage(UnitValue(1000,"px"));
doc.saveAs(buildFilename(activeDocument.fullName,'webexport',undefined,'jpg'),jpgOpts,true);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
progressor.done();
} // if(fileList) {