Page 1 of 1

How to select all except one type of file?

Posted: 12 Jul 2014 17:32
by Papoulka
.
I have tried every combination of Sel, Selfilter, and switches and can't see how to do this in a script. I also find only one thread previously, and it doesn't go quite far enough. So I think I'll be putting this on the Wish list. But XY has so much power that I could be missing a reasonably simple method.

What I want to do is select all files except .PPP files - and no folders. I know how to select everything except .PPP files (selfilter followed by sel inversion). But that leaves folders selected.

My only remaining idea is some regex pattern extraction into a variable, then use that in selfilter... but I know that regex to find 'lack of material' is not standard and very complex when it does work.

Again, after all this time it seems like someone would have nailed this, but I haven't run across it.

Thanks for any help.

Re: How to select all except one type of file?

Posted: 12 Jul 2014 18:51
by bdeshi
Select Edit->Select->Selection Filter.
try this filter:

Code: Select all

*:!*.PPP
!*.PPP means, as you can tell, everything except *.PPP files and the *: means select files only (no folders)


I learned about selection filters only a few days ago.

Re: How to select all except one type of file?

Posted: 12 Jul 2014 19:52
by Papoulka
.
Thank you, Sammay, that does work as you describe using menu commands, but not in a script. Using Try Script,

selfilter "*:!*.PPP"

does nothing.

Nor does 'sel f' (to select all files) then selfilters trying to drop all except .PPP.

Further ideas appreciated!

Re: How to select all except one type of file?

Posted: 12 Jul 2014 21:27
by highend
Don't know if I get you wrong but selecting all files with one extension exception is pretty easy in a script:

Code: Select all

selectitems formatlist(listfolder(, , 1), "f", , "!*.ppp");

Re: How to select all except one type of file?

Posted: 12 Jul 2014 22:31
by Papoulka
Thanks highend, that works perfectly.

I'm still at a more basic level and don't yet know which tool to try first.

This would be a good example to add to the Help, I think.

BTW, any idea why selfilter "*:!*.PPP" didn't work in a script? Should it have? It looked right and worked when entered manually.

Re: How to select all except one type of file?

Posted: 13 Jul 2014 06:35
by bdeshi
Papoulka wrote:Thank you, Sammay, that does work as you describe using menu commands, but not in a script.
Thought you were manual-browsing :)
Papoulka wrote:any idea why selfilter "*:!*.PPP" didn't work in a script?
Probably because the *: part is only valid for Selection Filters...

Re: How to select all except one type of file?

Posted: 13 Jul 2014 14:22
by highend
And the help file doesn't say anything about selfilter being able to invert the selection via "!".

Code: Select all

selfilter "*:!*.PPP"
doesn't work for me (at all) in the address bar.

Re: How to select all except one type of file?

Posted: 13 Jul 2014 15:54
by Papoulka
.
No, the Help doesn't say Selfilter will use the "!". I was hoping it would work anyway. It was interesting that when "*:!*.PPP" is entered manually via Edit |Select | Selection Filter (without quotes), it does work. When used as a Selfilter argument, it does not. It would be nice, and seem consistent, if it did.

Essentially, since all except the "!" do work in Selfilter, I thought perhaps that was an inadvertent omission.

Thanks for the help.

Re: How to select all except one type of file?

Posted: 17 Feb 2022 19:32
by kotlmg
how to select all files except all the folders?

Re: How to select all except one type of file?

Posted: 17 Feb 2022 19:37
by admin
Edit | Select | Select All Files (Ctrl+Shift+Alt+M)

Re: How to select all except one type of file?

Posted: 17 Feb 2022 19:47
by kotlmg
thanks a lot.