2010-05-27 6 views
1
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'" 

답변

-1

하나의 간단한 방법 ...

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 
+0

죄송합니다, 잊어 버렸습니다 휴지통으로 삭제해야한다는 언급 – Irwan

1

을 (휴지통으로 이동하지 않습니다)

관련 문제