Trash a File Action Fails After Last Dropbox Update

Hey Peter (@peternlewis),

I’m posting what I believe may be a bug I’ve been encountering ever since the last major Dropbox update that required moving the directory to ~/Library/CloudStorage. Basically, the trash a file action no longer works.

I’ve put together a test macro to document this, and included in the comments more details about what is going on. Let me know what additional info, if any, you need.

-Chris

Trash file fails after Dropbox update.kmmacros (18 KB)

Macro screenshot (click to expand/collapse)

Well, that's odd...

What happens when you select the file in question and run this AppleScript?

tell application "Finder"
   set finderSelectionList to selection as alias list
   if length of finderSelectionList = 0 then error "No files were selected in the Finder!"
   set theItem to item 1 of finderSelectionList
   delete theItem
end tell

The DropBox folder is known to have odd behaviour, whether because of DropBox or because of Apple’s CloudStorage system.

Trashing a file essentially moves the file from its location to a location within the trash folder on the same disk. It's possible the file cannot be moved, or that there is no trash folder on whatever is the effective disk of the cloud storage system.

I'd suggest you copy it to somewhere else, then delete it, then trash the file you copied, which should essentially be the same.

1 Like

The AppleScript works to trash the file.

Glad to hear it’s a known issue. Thanks for the tip about copying/deleting. I wish there was a way to trash files from the CLI instead of deleting only. It would be much smoother and easier.

2 Likes

I spent a fair amount of time this morning looking for CLI tasks, discarded several, and never found this one. It’s exactly what I’m looking for. As usual, you’re the man, thanks Chris.

1 Like

I was having similar odd behavior, and I was able to solve it (at least for my use case) by changing the relevant KM actions from Trash File to Delete File.

1 Like

I found that to work as well. Fortunately, with the CLI app Chris recommended in the above comment, I’m able to trash again instead of deleting.

1 Like