This is a simple button which empties the Recycle Bin, and where the button's icon changes to indicate if the Recycle Bin is empty or not.
It uses the Windows Recycle Bin icons from shell32.dll. (Icon IDs 31 and 32.)
The "full" icon is the button's default image. Within the command, the
modifier is used to override the icon when the recycle bin is empty.
RECYCLEBINEMPTY is a special condition built in to Opus for exactly this purpose. But you can also test for things like variables set by commands and scripts.
FORCE argument from the last line if you'd like to see a confirmation dialog before anything happens (assuming you have Windows set to confirm emptying the recycle bin).
QUIET argument to the last line if you'd like to prevent any progress dialog while the recycle bin is being emptied.
Tip: When editing a button which uses
Ctrl and click where it says @icon to open an image picker, so you don't have to manually work out the path and icon ID.
An older way of doing something similar was posted here:
The following scripts and buttons will give you a multifunction recycle bin button... (see attachments below)
Left-click goes to recycle bin
Right click empties recycle bin and updates button icon to empty recycle bin icon. (Optionally plays empty …
Very cute! Interesting info, too.
(The .dcf ruins the show by differing slightly from the screenshot)
I think the only differences are the Large Icon and Show Label checkboxes. I must've changed those between saving the two files.
To disable the button's action when the recycle bin is empty, add this line before the
Delete EMPTYRECYCLE FORCE
For usabilty, it is mainly a visual clue, because it only prevents emptying an empty recycle bin.
@Leo's tip about holding Ctrl and clicking the
@icon line, you can also double-click the
@icon line to open the image picker.
There is no need. The icon of the recycle bin is automatically set according to the status of the recycle bin. The status of the recycle bin can be easily seen from the icon. This is the biggest feature of this button.
It's nice with Windows 10 where the recycle bin icons are quite hard to tell apart.