Delete only files, excluding folders, from collection?

Hi - firstly, apologies if this has been asked before, I wasn't really sure how to describe the issue properly.

I have a custom button set up that's very simple, it just does

SELECT ALLFILES
DELETE

When I click this button in a normal folder, it works as intended and deletes the files without touching any subfolders. Here are the steps to reproduce my issue.

1.In a folder of images, mark some images
2. Go to the collection folder and put some or all images into a folder
3. Move that folder back to the original folder
4. Click the button mentioned above
5. Expected - all the files will be deleted and the folder will be ignored
Actual - the files and folder are both deleted

If I do a ctrl+z to remove the files and folder from the trash, then hit the button again, it works as expected.

I realize this is perhaps an edge case, so if there's another way to do this that will work as expected, please let me know and I'll be happy with that!

I should have mentioned, I'm using version 12.30 build 8360 x64 Pro

I'm not sure exactly what is meant here. Are you creating a second collection inside the main collection, or are you creating an actual folder/directory somewhere else and moving the files there?

In either case, Select ALLFILES would not select the folder or collection, or at least does not when I try it.

Select ALLFILES also will not deselect something that is already selected. And if you go into a sub-folder or sub-collection and then back up again, the folder or collection may be selected at that point. That may be what's going wrong. You should add DESELECTOTHERTYPE to the command to ensure nothing else is left selected.

hi Leo,

thanks for your reply!

Blockquote
Select ALLFILES also will not deselect something that is already selected. And if you go into a sub-folder or sub-collection and then back up again, the folder or collection may be selected at that point. That may be what's going wrong. You should add DESELECTOTHERTYPE to the command to ensure nothing else is left selected.

This was exactly right, thank you. When I normally use the button, I don't have a folder selected so it was working fine. When you copy or move something from a collection though, it ends up highlighted in the original folder (which is where I was moving it). Adding the deselect worked - if anyone else needs this, here's the command I ended up with

SELECT ALLFILES DESELECTOTHERTYPE
DELETE

thanks again!!