Help in creating a custom button, plez

Alright, this one has got me confused. I've searched the help file for Opus 11.18, but I just get lost in a trail of information. What I'd like to do is create a button that will delete any directories in the active lister that have a size of less than 100 KB, with a confirmation dialog just prior to doing the actual deletion. At times, this might total 4 directories, at other times, there might not be any at all. So, I come with hat in hand, and ask for help. I would consider this an education by way of spoon-feeding. :smiley:

Many thanks for any enlightenment!

No thoughts, Leo?

I am putting forth my best effort on this one, but my best isn't cutting it.

The workflow of the button should go something like this: SelectAll, GetSizes, Select Size= [ (less than 100KB) This is where I get stuck ], Delete Selected .

So, I have made a test folder with 2 folders in it, one empty and one with a large file. I then created a new button, and entered the above commands in the Advanced section. The SelectAll works fine, the GetSizes works fine, but I get stuck on the section where I want it to select folders with <100 KB. Nothing I do seems to work.

I have dropped the idea of a confirmation dialog, for the time being, just so I can try to get the basic button up and running.

I would very much appreciate any help on this.

Alright, I've found that I was trying to make things too difficult. I now have the button working with the following

GetSizes
Select Size <100kb
Delete

Fine and well. At this point I still seek help with adding a confirmation dialog box to the buttons' code, informing me of what folders will be deleted, and asking for permission to proceed.

Any pointers on that?

The SelectEx-ScriptAddin should be able to select folders within a size range:

SelectEx FOLDERS LINEAR MAXSIZE=100kb ITEMCOUNTPERC=100 MAKEVISIBLE DESELECTNOMATCH

Find it here: [Command: SelectEx (extended Select command))

Thanks, tbone! I'll look into it, and see if it works for me.

Appreciate the input.

And the Confirm-ScriptAddin should give you a proper confirmation dialog, listing affected items:

Confirm MSG="Really delete {#selitems$} items?\n" TITLE="Delete Folders" ITEMS={allfile$}

Combined:

Select NONE
SelectEx FOLDERS LINEAR MAXSIZE=100kb ITEMCOUNTPERC=100 MAKEVISIBLE DESELECTNOMATCH
Confirm MSG="Really delete {#selitems$} item(s)?\n" TITLE="Delete Folders" ITEMS={allfile$}
Delete QUIET

The "Select NONE" at the top is required because of some specific DO magic.
The Confirm Script-Addin can be found here (still missing some more detailed description):
https://www.directory-opus.de/forum/viewtopic.php?p=1644#p1644

Et voilĂ  o):

EDIT: Url to script addin updated (german DO forum was closed / reopened).

Outstanding, I believe that will do the trick!! Now, I just have to learn how to apply the scripts and such, and when I've done that, I'll post back with my results. Very kind of you to help!!

OH, that is SWEET !! Does everything I need, and in such an elegant way.

I tip my hat to you, sir!!

Glad you like it. o)