Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var F = Folder.selectDialog("フォルダを選択してください");
- main(F, "filePath", true);
- function main(F, scptFile, closeFile) {
- var inddFiles = F.getFiles("*.indd");
- var resAry = ["以下のファイルを正しく処理できませんでした"];
- var indd, flag;
- if (!inddFiles) {
- exit();
- }
- if (!File(scptFile).exist) {
- alert("ファイル:'" + scptFile + "'が存在しません");
- exit();
- }
- for (var i=inddFiles.length-1; i>=0; i--) {
- flag = false;
- try {
- indd = app.open(inddFiles[i]);
- $.evalFile(scptFile);
- flag = true;
- } catch(e) {
- resAry.push("File: "+inddFiles[i].name+"\r "+e);
- } finally {
- if (flag && closeFile) {
- indd.close(SaveOptions.YES, inddFiles.fullName);
- }
- }
- }
- if (resAry.length > 1) {
- alert(resAry.join("\r"));
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement