AppleScript的。如何删除隐藏文件夹或将其移至废纸篓?

时间:2013-11-21 17:52:01

标签: macos applescript

我试着这样做:

tell application "Finder"
    move folder "Macintosh HD:Users:Mark:Desktop:.folder" to the trash
end tell

但脚本编辑器会讨论这样的错误:

tell application "Finder"
    move folder "Macintosh HD:Users:Mark:Desktop:.folder" to trash
        --> error number -1728 from folder "Macintosh HD:Users:Mark:Desktop:.folder"

P.S。我对自己糟糕的英语感到抱歉。

1 个答案:

答案 0 :(得分:2)

这将删除该文件夹,您将无法在垃圾箱中找到它......

tell application "System Events"
    delete folder "Macintosh HD:Users:Mark:Desktop:.folder"
end tell