%dirname = InputDirectory("C:\JUST\ドキュメント\MYHOME\") if %dirname = nil then stop end if %filelist=GetFileList(%dirname,"*.jtd") !!%ans = Alert(%dirname) foreach %f in %filelist %docfile = Replace(%f,Len(%f)-2,3,"doc") %docpath = Fsub("%s%s",%dirname,%docfile) %fpath = Fsub("%s%s",%dirname,%f) if ExistFile(%docpath) then !!continue foreach end if !!%filename=GetDocumentName(1) %ans = Alert(Fsub("%s を\n%s に保存します",%fpath,%docpath)) if %ans = 1 then 文書起動読込(%fpath) 文書保存(.ファイル名=%docpath,.見出し="",.保存形式=20,.保存方法=1,.参照専用保存=0,.ビジュアル保存=0) QuitDocumentWindow() end if next