Hi all,
Itâs a shame macOS doesnât support the trash on certain types of network drives (which Cryptomator is an example of).
I see Linux handles it just fine. Thatâs yet another reason to go over to Linux if you want privacy!
On macOS, this idea inspired me to set up my own alternative trash situation for my Cryptomator. I call it âCRYPTOTRASHâ.
Itâs an AppleScript script I bind to the usual delete cmd-backspace
hotkey in Finder (using Keyboard Maestro to bind it and only applying to while in the Finder app).
This code checks your selection to determine whether itâs inside your Cryptomator volume. If it is, it does a cool âmove to CRYPTOTRASHâ action. If not, it just performs the normal Finder âmove to trashâ action.
CAREFUL - cautiously test on dummy files before you use it on real files in your Cryptomator. This actually hard deletes whatever you select, YOU WILL LOSE DATA IF YOU DONâT SET UP THE FOLDERS PROPERLY.
(I couldnât get it to MOVE files into the virtual trash, but only COPY them, so I had to add an extra hard DELETE action to simulate normal trash binning.)
Instructions:
- You cannot have your Cryptomator mount to a custom path. Have it to automatic like
/Volumes/35GrE6R1HwRY_0
(and change script code accordingly.)
- Customise your chosen
/Users/Nate/CRYPTOTRASH
path in code.
- Not sure if needed, but I updated my osxfuse to the latest, it was out of date by many months.
- If you have non-cryptomator normal NAS shares like a samba share from a LAN, customise below for any paths that apply.
tell application "Finder"
set thePath to the POSIX path of (parent of first item of (get selection) as alias)
tell application "Finder"
if thePath contains "/Volumes/35GrE6R1HwRY_0" then
set destFolder to "/Users/Nate/CRYPTOTRASH" as POSIX file
move selection to folder destFolder
delete selection
else
if "/Volumes/LANsamba1" is in thePath or "/Volumes/anotherNAS" is in thePath then
display alert "Are you sure you want to delete this?" message "macOS can only hard-delete NAS files. This item will be deleted immediately. You canât undo this action." buttons {"Cancel", "Delete"}
if button returned of result = "Delete" then
delete selection
else
if button returned of result = "Cancel" then
""
end if
end if
else
move selection to trash
end if
end if
end tell
end tell
I only just started testing it but seems to work reliably. Of course, it will have no âput backâ functionality, but at least this way I can worry less about accidentally immediately irreversibly deleting files. Thatâs the whole point.
You can also script up other things to automate CRYPTOTRASH emptying as mentioned here. Go to town, even bind some âempty trashâ dock item to empty both normal trash and your CRYPTOTRASH.
Since I only use Cryptomator to have privacy from cloud services, I consider it safe to copy files outside of my Cryptomator solely for preventing data disasters. I wasnât able to get it to work if my CRYPTOTRASH is inside my actual Cryptomator. Iâd prefer that, so if someone has an improvement, please share.