Skip to content

Instantly share code, notes, and snippets.

@erikccoder
Created July 31, 2015 17:36
Show Gist options
  • Save erikccoder/717a48057b715946c624 to your computer and use it in GitHub Desktop.
Save erikccoder/717a48057b715946c624 to your computer and use it in GitHub Desktop.
on open theFileDropped
display alert "Are you sure you want to permanently delete " & the length of theFileDropped & " file(s)?" message "You cannot undo this action." as warning buttons {"Cancel", "OK"} default button 2
if the button returned of the result is "OK" then
repeat with aFile in theFileDropped
do shell script "rm -Rf " & quoted form of POSIX path of aFile
end repeat
do shell script "afplay \"/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/finder/empty trash.aif\""
end if
end open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment