-
Notifications
You must be signed in to change notification settings - Fork 9
/
wr-saveandcloseall.js
70 lines (59 loc) · 1.75 KB
/
wr-saveandcloseall.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//////////////////////////////////////////////////////////// english //
// --------------------------
// -=> WR-SaveAndCloseAll <=-
// --------------------------
//
// A Javascript for Adobe Illustrator
// by Wolfgang Reszel ([email protected])
//
// Version 0.2 from 5.8.2003
//
// This script saves and closes all open documents.
//
// To enable the english messages change the "de" into "en" in line 40.
//
// Sorry for my bad english. For any corrections send an email to:
//
//////////////////////////////////////////////////////////// Deutsch //
// --------------------------
// -=> WR-SaveAndCloseAll <=-
// --------------------------
//
// Ein Javascript fuer Adobe Illustrator
// von Wolfgang Reszel ([email protected])
//
// Version 0.2 vom 5.8.2003
//
// Dieses Skript speichert und schliesst alle offenen Dokumente.
//
// Um dieses Skript mit deutschen Meldungen zu versehen, muss in Zeile
// 40 das "en" durch ein "de" ersetzt werden.
//
// Verbesserungsvorschlaege an: [email protected]
//
//$.bp();
// -------------------------------------------------------------------
var language="en"; // "de" fuer Deutsch
// -------------------------------------------------------------------
var WR="WR-SaveAndCloseAll v0.2\n\n";
if (language == "de") {
var MSG_nodocs = WR+"Kein Dokument ge\xF6ffnet.";
var MSG_ask = WR+"Sollen alle Dokumente gespeichert und geschlossen werden?";
} else {
var MSG_nodocs = WR+"You have no open document."
var MSG_ask = WR+"Are you sure to save and close all open documents?";
}
var itemstoprocess=0;
var error=0;
var Docs=documents.length;
if (Docs<1) {
error++;
alert(MSG_nodocs);
} else {
if(confirm(MSG_ask)) {
for(var i=0;i<Docs;i++) {
activeDocument.close(SaveOptions.SAVECHANGES);
}
}
}