Trash Macro Group Macros (v9.0.4)

Trash Macro Group Macros (v9.0.4)

Hello,

The attached macro group is a replacement for the Dock's Trash icon. I've put both macros on a palette.

If anyone has suggestions for improving or fixing the macros (or if someone can point me in the proper direction to implement option-clicking the palette's button to open the Trash window in the Finder), much appreciated in advance!

Trash Macro Group Macros.kmmacros (61 KB)

Your macro doesn’t run for a couple of reasons, but maybe you don’t need that macro at all.

If I interpret the macro correctly, it’s basically this what you’re trying to achieve:

  1. You select a file in the Finder and press the macOS standard shortkey for deleting a file (⌘-Delete).
  2. File gets moved to the Trash and your second macro immediately empties the Trash.

If this is correct, then why aren’t you just deleting your file with ⌥⌘-Delete? (This bypasses the Trash and deletes the file immediately.)

Though I wouldn’t recommend to make this (and neither the use of macros/actions that delete files immediately) a habit, since once in a while it will happen that you accidentally delete the wrong thing…

For your second question…

This will open the Trash in a Finder window:

01-pty-fs8

This is the same, but with a modifier-key condition:

53-pty-fs8
Open Finder Trash.kmmacros (30.9 KB)

I’ve used instead of , because by default when you click a palette macro with , it opens the macro for editing in KM Editor.

Hi Tom,

Many thanks for taking time to respond to my post.

The macros don't run???

I'm stumped…I tested them (prior to posting here) under varying conditions and they worked as intended (I was a software QA analyst in a previous career).

I did not observe the outcome that deleting a file selected in the Finder resulted in the immediate emptying of the Trash. In fact, I did that with a number of files yesterday afternoon using the keyboard shortcut and the files are still n the Trash (I opened its window in the Finder using Go>Go to folder… to confirm).

And for good measure, I just tried it again and the file went to the Trash without the Trash automatically emptying.

Maybe this discrepancy in our observations is due to my having both macros in a group which is configured as a palette, and you don't??? As such, the palette has a single button which toggles between the two icons—Trash full, Trash empty—which are assigned to the two macros.

Regardless, many thanks also for teaching me for how to open the Trash folder. Now I can add that feature to the palette's button(s).

Barry

Version 2 supports opening a Finder window for the Trash (many thanks again, Tom).

The uploaded macro group contains two macros ("Empty Trash" and "Trash Emptied") for placement on a palette. The former displays 1) a full Trash icon, 2) the Trash window after command-clicking the icon, and 3) empties the Trash after clicking the icon without a modifier key. The latter displays an empty Trash icon and moves a selected item to the Trash after you press command-delete.

Trash Macro Group Macros v. 2.kmmacros (62.3 KB)