Salut à tous,

pensez-vous qu'il soit possible d'implémenter un algorithme de calendrier grégorien dans ce script ? avec les réponses et les images renommées aléatoirement. Je l'utilise avec Fireworks pour mon travail, et même si le traitement par lots est rapide, comme il est incomplét il ne me sert pas.
Donc je suis dubitatif...
Thanks.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
 
try {
 
(function()
{
	var k = {
		StartYear: 2007,
		EndYear: 2007,
		DayCounts: [ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]
	};
 
	if (fw.documents.length == 0) {
		return;
	}
 
	var dom	= fw.getDocumentDOM();
 
	dom.selectAll();
 
	if (fw.selection.length == 0 || fw.selection[0].toString() != "[object Text]") {
		alert("The top-most object should be a text block.");
		return;
	}
 
	var exportPath = fw.browseForFolderURL("Choose a folder to export the frames to", 
			dom.lastExportDirectory || dom.filePathForRevert);
 
	if (!exportPath) {
		return;
	}
 
	var date = fw.selection[0];
	var initialAttrs = eval("(" + date.textRuns.initialAttrs.toSource() + ")");
 
		// clone the doc's exportOptions
	var exportOptions = eval("(" + dom.exportOptions.toSource() + ")");
 
	fw.selection = [fw.selection[0]];
 
	for (var year = k.StartYear; year <= k.EndYear; year++) {
		var exportDirectory = exportPath + "/" + year;
		Files.createDirectory(exportDirectory);
 
		for (var month = 1; month <= 12; month++) {
			for (var day = 1, len = k.DayCounts[month]; day <= len; day++) {			
				dom.setTextRuns({ 
					initialAttrs: initialAttrs, 
					textRuns: [{ 
						changedAttrs: {}, 
						characters: [(day + 100 + "").slice(1), "-", (month + 100 + "").slice(1), "-", year].join("") 
					}]
				});
 
				var filename = [year, "-", (month + 100 + "").slice(1), "-", (day + 100 + "").slice(1)].join("");
 
				dom.exportTo(exportDirectory + "/" + filename, exportOptions);
			}
		}
	}
})();
 
} catch (exception) {
	alert([exception, exception.lineNumber, exception.fileName].join("\n"));
}