How to select all except one type of file?

Discuss and share scripts and script files...
Post Reply
Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

How to select all except one type of file?

Post 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.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

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

Post 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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

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

Post 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!

highend
Posts: 13311
Joined: 06 Feb 2011 00:33

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

Post 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");
One of my scripts helped you out? Please donate via Paypal

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

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

Post 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.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

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

Post 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...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 13311
Joined: 06 Feb 2011 00:33

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

Post 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.
One of my scripts helped you out? Please donate via Paypal

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

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

Post 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.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

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

Post by kotlmg »

how to select all files except all the folders?

admin
Site Admin
Posts: 60538
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

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

Post by admin »

Edit | Select | Select All Files (Ctrl+Shift+Alt+M)

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

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

Post by kotlmg »

thanks a lot.

Post Reply