下面的脚本应该删除所有以.aux等结尾的文件。 在当前目录中(即在取景器窗口中显示的目录) 该脚本似乎停止删除.aux文件。 任何提示都是受欢迎的。
try
tell application "Finder"
set lieu to target of window 1
set finale to {".aux", ".log", ".bak", ".out", ".synctex.gz"} as list
repeat with x in finale
try
delete (every item of lieu whose name ends with x)
end try
end repeat
end tell
say "Mess cleaned up"
on error
display dialog ("Error. Couldn't Delete the File") buttons {"OK"}
end try
答案 0 :(得分:0)
这是使用rm
的版本:
tell application "Finder"
set lieu to target of window 1 as text
set posixPathOfLieu to POSIX path of lieu
set shellScript to "cd" & space & quoted form of posixPathOfLieu & ";rm *.aux *.log *.bak *.out *.synctex.gz"
try
do shell script shellScript
end try
end tell
使用rm
时,请非常小心。错误位置的一个空格字符可以删除所有内容。