Skip to main content
Added osascript variant, suggested by Chris
Source Link
mspasov
  • 6.4k
  • 27
  • 40

Another solution would be to create AppleScript containing the folowing code

tell application "Finder"
    empty the trash
end tell

save it as emptytrash for example and execute it via open emptytrash.app

or even better (as suggested by Chris) - execute:

osascript -e 'tell app "Finder" to empty'

Since trash is a Finder thing, this should be more compatible in the long run.

Another solution would be to create AppleScript containing the folowing code

tell application "Finder"
    empty the trash
end tell

save it as emptytrash for example and execute it via open emptytrash.app

Since trash is a Finder thing, this should be more compatible in the long run.

Another solution would be to create AppleScript containing the folowing code

tell application "Finder"
    empty the trash
end tell

save it as emptytrash for example and execute it via open emptytrash.app

or even better (as suggested by Chris) - execute:

osascript -e 'tell app "Finder" to empty'

Since trash is a Finder thing, this should be more compatible in the long run.

Source Link
mspasov
  • 6.4k
  • 27
  • 40

Another solution would be to create AppleScript containing the folowing code

tell application "Finder"
    empty the trash
end tell

save it as emptytrash for example and execute it via open emptytrash.app

Since trash is a Finder thing, this should be more compatible in the long run.