答案 0 :(得分:1)
您将删除文字字符串 "Downloads"
的每一项,这毫无意义。添加 folder
说明符
tell application "Finder"
delete (every item of folder "Downloads" of folder currentUser of folder "Users" of startup disk whose name is not in {"PreciousFolder"})
end tell
或更短
tell application "Finder"
delete (every item of (path to downloads folder) whose name is not in {"PreciousFolder"})
end tell