1
tell application "Finder"
set deletedfile to alias "Snow Leopard:Users:test.pdf"
delete deletedfile
end tell
問題是我反覆從我的Cocoa應用程序調用這個腳本,所以聲音反覆播放。是否可以禁用該聲音?刪除文件而不在Applescript中播放聲音?
tell application "Finder"
set deletedfile to alias "Snow Leopard:Users:test.pdf"
delete deletedfile
end tell
問題是我反覆從我的Cocoa應用程序調用這個腳本,所以聲音反覆播放。是否可以禁用該聲音?刪除文件而不在Applescript中播放聲音?
一個簡單的方法,因爲垃圾只是您的家庭文件夾內的文件夾,看不到你可以做到這一點(不移動到回收站)
do shell script "rm '/Users/test.pdf'"
...
set myFile to (path to desktop folder as text) & "myFile.txt"
set trashFolder to path to trash folder from user domain
do shell script "mv " & quoted form of POSIX path of myFile & space & quoted form of POSIX path of trashFolder
對不起,忘提及我需要刪除垃圾 – Irwan 2010-05-27 02:53:54