applescript で Thumbs.db削除したい
mac os 10.5.8 で下記のような applescript を作成しましたが、
Thumbs.db ファイルが削除されません。
try
setafoldertochoose folderwith prompt"DS_Store と ._ がつく、すべてのファイルを削除するフォルダを選択"
setanstodisplay dialog"対象フォルダ以下のフォルダも対象にしますか?"buttons{"いいえ","はい"}default button2
ifbutton returnedofansis"はい"then
setsubfoldertotrue
else
setsubfoldertofalse
endif
setufoldertoPOSIX pathofafolder
ifsubfolderthen
setmycommand1to"find \""&ufolder&"\" -name .DS_Store -exec rm {} \";\""
setmycommand2to"find \""&ufolder&"\" -name \"._*\" -exec rm {} \";\""
setmycommand3to"find \""&ufolder&"\" -name Thumbs.db -exec rm {} \";\""
else
setmycommand1to"rm \""&ufolder&".DS_Store\""
setmycommand2to"rm \""&ufolder&"._*\""
setmycommand3to"rm \""&ufolder&"Thumbs.db\""
endif
do shell scriptmycommand1
do shell scriptmycommand2
do shell scriptmycommand3
display dialog"処理は終了しました。"
onerrorerr
display dialogerr&return&"エラーが発生しました。終了します。"
endtry
PowerMac G5-OTHER, Mac OS X (10.4.11)