LAN Trash (trash files on SMB shares instead of deleting them)

Description

LAN Trash extends the Finder's "trash" action (when activated by ⌘-⌫) so that files on locally mounted SMB volumes are also sent to the Trash instead of being deleted. The Trash folder used is the one on the server.

MacOS works with the expectation that your Mac will be connected to the Internet, yet the Finder behaves as if handling files over a local network (LAN) is an unusual case. Selecting files in the Finder and hitting ⌘-⌫ will move the files to the Trash if they are on a local volume, but the same keystroke will only give you the option of deleting the files immediately if they are on another Mac—and then you may have to click inside "fun size" alert boxes that are complaining about permissions or the files being in use somehow.

It would be better if ⌘-⌫ trashed files on remote volumes too. LAN Trash makes this possible.

Installation

  • Download both macros and import them.
  • Consult the README for the macro "Put out the LAN Trash", which is in the macro group "LAN Trash on server".

Caution

I have found this pair of macros to be reliable on my Macs, but if you use these macros, you do so entirely at your own risk. The macros never delete files. Nevertheless, please, as always, back up your Macs before trying any imported macros.

Move files to LAN Trash.kmmacros (15 KB)

Put out the LAN Trash.kmmacros (31 KB)

Phew! At last "LAN Trash" has been posted.[1] You would not believe how long I took working on these macros long after they could already do the basic job. Much of that time was spent on either reworking groups of actions (when I realised there was an easier way) or adding and then removing features that didn't seem essential.

Now is the time for me to be told that someone came up with a better solution years ago. :rofl: Go ahead, it's fine…

I use SMB shares over LAN a lot, and encountering the callous "This item will be deleted immediately. You can't undo this action." message all the time was simply not good enough. Now when I hit ⌘-⌫ the remote files disappear on their way to the volume's Trash. If you like the idea of that, I hope you will like this pair of macros.


  1. And now it's even in the correct forum category. This was the difficult part of the process! :exploding_head: ↩︎