The JavaScript accesses the data directory of the job as part of an event, e.g. ‘Before scanning’, in order to read the file name and file size.

//———————————————————————————-

folder = job.folder;
target_file = folder + “/order.dat”;

str = “[General]\n”;
str += ‘JOBNAME=’ + job.name + ‘\n’;
str += ‘NUM_PAGES=’ + job.numPages.toString() + ‘\n’;

for (i = 1; i < 20; i++) {
idx = job.index(i);
if (idx.length > 0) {
str += ‘KEY’ + i.toString() + ‘=’ + idx + ‘\n’;
}
}

str += “[Pages]\n”;

for (i = 1; i <= job.numPages; i++) {

page = job.pages[i-1];

// str += ‘P’ + i.toString() + ‘=images/’ + ut.getFilenameFromString (page.fileName) + ‘\n’;
str += ‘P’ + i.toString() + ‘=images/’ + page.fileNameOnly + ‘\n’;
str += ‘L’ + i.toString() + ‘=’ + page.fileSize.toString() + ‘\n’;

}

ut.writeStringToFile(target_file, str);

//—————————————————————————————–