-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathprintexport.jsx
More file actions
executable file
·53 lines (33 loc) · 1.41 KB
/
printexport.jsx
File metadata and controls
executable file
·53 lines (33 loc) · 1.41 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
43
44
45
46
47
48
49
50
51
52
53
/*
* This is Javascript for Adobe Photoshop CS3 to export multiple images for printing
*/
// Include the utilities
#include util.jsxinc
#include Progressor.jsxinc
// Set a script name
var scriptName={en:"export script (print)",de:"Export-Skript (Druck)"};
// Saving options
var jpgOpts = new JPEGSaveOptions();
jpgOpts.embedColorProfile=true;
jpgOpts.quality=12; // highest
var log='';
var fileList=File.openDialog(localize({en:"Choose files to export for print",de:"Wählen Sie Dateien zum exportieren für den Druck"}),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]);
// check some common errors
if(doc.colorProfileName!=="ISO Coated v2 300% (ECI)") // ensure color profile
log+='File '+fileList[i].name+' had color profile '+doc.colorProfileName+'\n';
if(doc.resolution!==300) // ensure 300dpi
log+='File '+fileList[i].name+' had dpi '+doc.resolution+'\n';
doc.flatten();
doc.saveAs(buildFilename(activeDocument.fullName,'printexport',undefined,'jpg'),jpgOpts,true);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
progressor.done();
log+='Exported '+fileList.length+' documents.\n';
alert(log);
} // if(fileList) {