Goal: Create a catalog item that shows a given location (or mutliple locations) in branch view filtered by file attributes
More specifically, show everything EXCEPT read-only files. In other words I only want to see writable files, but I want to see them in branch view so I can see things indented in their hierarchical folders. Most of the files in this location and sub-folders will be read-only, so I am trying to expose the few that aren't.
I tried lots of options from Address Bar figuring whatever worked there would work in catalog, but no success.
For example, this in the address bar shows me the hierarchical folder view and only sql files:
C:\Projects\?*.sql /:flat
But I need to filter based on attribute. So, after looking at syntax for attributes, it looks like I should use this to display everything that is NOT read-only:
C:\Projects\?!attr:r /:flat
But that doesn't show any files that it should
QUESTION 1: Does quick search support attribute searching (and negating attributes), and if so, what does that syntax look like?
Then I played with the catalog some.
Given:
Catalog Item 1
Location: C:\Project\? /:flat
Action on click: Go to Location
(in the catalog panel the icon shows as Branch View)
Catalog Item 2
Location: |!attr:r (notice the !bang, as I want this filter to show files OTHER THAN read-only)
Action on click: Go to Location
(in the catalog panel the icon shows as a folder with small diamond on lower right)
I click on Catalog Item 1.
I see branch view of target folder with folder icons and groups of indented files within each. This is as expected.
I click on Catalog Item 2
The list is filtered as expected. I see all the folder elements and only those files that are NOT read-only
Those 2 catalog items get the job done for me.
QUESTION 2: Is there a way to combine into one catalog entry?
Note: Eventually I want to use multiple folders for the location (Multi-Branch View), so hopefully the solution allows for that as well. I was able to put mult folders into Catalog Item 1 separated by semicolons and it worked. I'm only stating this in case someone comes at this from another angle.
Thanks
kevin
Show a location in branch view filtered by file attr
-
kmccabe
- Posts: 13
- Joined: 03 Sep 2014 18:27
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Show a location in branch view filtered by file attr
Hello and welcome to the club!
1) Currently quick search does not support an attr selector like some other XY features.
There is however a shell property System.FileAttributes which could be used instead.
This might get you close: ?!prop:System.FileAttributes:R /:flat
Unfortunately, it appears to not test folders instead returning them all regardless of their attributes.
You could limit it to just files by making it: ?!prop:System.FileAttributes:R /:flatfiles
2) You can use the above patterns as they are in the catalog to search the current path. If you want to always search a specific path or paths just prefix the pattern with the ;-separated list of paths.
C:\A\Path;C:\B\Path?!prop:System.FileAttributes:R /:flat
If you find that the filter approach you were using worked better for you then it is possible to combine those into a single catalog item by making it a script using the following as the location:And if you want it to include the paths use:Though it might be worth replacing the second goto in each (which does the filtering) with a call to the actual filter scripting command instead:
I imagine Don will eventually add an attr selector to quick search, but until then hopefully these help you survive. 
1) Currently quick search does not support an attr selector like some other XY features.
There is however a shell property System.FileAttributes which could be used instead.
This might get you close: ?!prop:System.FileAttributes:R /:flat
Unfortunately, it appears to not test folders instead returning them all regardless of their attributes.
You could limit it to just files by making it: ?!prop:System.FileAttributes:R /:flatfiles
2) You can use the above patterns as they are in the catalog to search the current path. If you want to always search a specific path or paths just prefix the pattern with the ;-separated list of paths.
C:\A\Path;C:\B\Path?!prop:System.FileAttributes:R /:flat
If you find that the filter approach you were using worked better for you then it is possible to combine those into a single catalog item by making it a script using the following as the location:
Code: Select all
::goto '? /:flat';goto '|!attr:r';Code: Select all
::goto 'C:\A\Path;C:\B\Path? /:flat';goto '|!attr:r';Code: Select all
::goto '? /:flat';filter '!attr:r';-
admin
- Site Admin
- Posts: 66297
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Show a location in branch view filtered by file attr
Probably "Let folders pass all filters" is ticked...TheQwerty wrote:Unfortunately, it appears to not test folders instead returning them all regardless of their attributes.![]()
FAQ | XY News RSS | XY X
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Show a location in branch view filtered by file attr
Indeed... I forget about those options that are not available anywhere except in the context menu of possibly hidden toolbar buttons.admin wrote:Probably "Let folders pass all filters" is ticked...TheQwerty wrote:Unfortunately, it appears to not test folders instead returning them all regardless of their attributes.![]()
-
kmccabe
- Posts: 13
- Joined: 03 Sep 2014 18:27
Re: Show a location in branch view filtered by file attr
Close? That is exactly what I needed!TheQwerty wrote: 1) Currently quick search does not support an attr selector like some other XY features.
There is however a shell property System.FileAttributes which could be used instead.
This might get you close: ?!prop:System.FileAttributes:R /:flat
Was happy seeing the folders display as I am still learning the folder structure for a certain project, and understood about folders passing filters already. However, in some places the structure is too big and /:flatfiles will be useful.TheQwerty wrote: Unfortunately, it appears to not test folders instead returning them all regardless of their attributes.![]()
You could limit it to just files by making it: ?!prop:System.FileAttributes:R /:flatfiles
That's what I ended up doing.TheQwerty wrote: 2) You can use the above patterns as they are in the catalog to search the current path. If you want to always search a specific path or paths just prefix the pattern with the ;-separated list of paths.
C:\A\Path;C:\B\Path?!prop:System.FileAttributes:R /:flat
And how about this for serendipity?
Just yesterday I wanted to launch XYplorer with a specific folder and wanted it to come up in Branch View.TheQwerty wrote:Code: Select all
::goto '? /:flat';filter '!attr:r';
I ended up with:
Code: Select all
run XYplorer.exe mypath /script="::#311;" Code: Select all
run XYplorer.exe mypath /script="::goto '? /:flat'" Thanks for the good and speedy help guys.
One last thing, though. I found a section on searching by properties in the help, but nothing about FileAttributes.
Could you point me to where you got prop:System.FileAttributes from? (whether xyplorer or some other source)
-
admin
- Site Admin
- Posts: 66297
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Show a location in branch view filtered by file attr
I have created a listing here (copied from the list here: http://www.xyplorer.com/xyfc/viewtopic. ... 95#p117195) :
http://www.xyplorer.com/faq-topic.php?i ... properties
http://www.xyplorer.com/faq-topic.php?i ... properties
FAQ | XY News RSS | XY X
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Show a location in branch view filtered by file attr
This came from a few sources and a rather convoluted path.kmccabe wrote:One last thing, though. I found a section on searching by properties in the help, but nothing about FileAttributes.
Could you point me to where you got prop:System.FileAttributes from? (whether xyplorer or some other source)
The fact that attr: is not available but prop: is came from the Quick Search page and the Find Files by Meta Properties section of Find Files.
That there was even an attributes property available could come from checking the list of available tips under Tools > Configuration > Information > File Info Tips. However, I did it via View > Columns > Add Column then right-clicking the column header for the new column (Undefined) and selecting Select Property. (This way I could easily see the format of the property in a column.)
There's lots of ways to reference a property but we recently discovered that the best way for compatibility across Windows versions and system languages is to use the canonical name. Don hasn't yet added those to the GUI so I went to Microsoft (Don's links are better!) where a good guess that it was under System allowed me to find it as System.FileAttributes.
That's a whirlwind through many pages of XY's help so here's a script you can run to jump to each section and read more:
Code: Select all
"Quick Search" ::help('idh_quicknamesearch.htm');
"Find Files by Properties" ::help('idh_find.htm#idh_findfilesbyproperties');
"Add Column / Soft Columns" ::help('idh_customcolumns.htm#idh_customcolumns_soft');
"Property() SC" ::help('idh_scripting_comref.htm#idh_sc_property');-
admin
- Site Admin
- Posts: 66297
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Show a location in branch view filtered by file attr
Note also these possible usages:
Find Files Name:
Code: Select all
text "<prop System.FileAttributes>";Code: Select all
prop:System.FileAttributes:rFAQ | XY News RSS | XY X
-
kmccabe
- Posts: 13
- Joined: 03 Sep 2014 18:27
Re: Show a location in branch view filtered by file attr
Don, that's quite a list. I've bookmarked it and noted your other uses. I've gotten pretty comfortable with your excellent program, but have yet to venture into scripting yet. That is probably a testament to the fact that many of the things people have had to resort to scripting for in the past are now features.
Or it could mean that I am scared or overwhelmed by it!
Funny how my question ties into another recent conversation. Always amused by how things converge...
Or it could mean that I am scared or overwhelmed by it!
Do you know how happy that makes me feel to know I didn't miss something trivial and obvious???TheQwerty wrote:This came from a few sources and a rather convoluted path.
Funny how my question ties into another recent conversation. Always amused by how things converge...
XYplorer Beta Club