macOS/iOS自动化指南

清空下载文件夹

2017-02-11  本文已影响16人  鸭梨山大哎

利用applescript清空下载文件夹

  tell application "Finder"
    set dls to folder "Downloads" of (path to home folder)
    delete (every file of dls)
    delete (every folder of dls)
end tell

同理可用于清空其他文件夹。把代码里的Downloads改成Desktop就可以

清空垃圾箱

tell application "Finder"
    empty trash
end tell
上一篇 下一篇

猜你喜欢

热点阅读