Page 1 of 1
Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 00:59
by kmccabe
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
Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 04:28
by TheQwerty
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:
Code: Select all
::goto '? /:flat';goto '|!attr:r';
And if you want it to include the paths use:
Code: Select all
::goto 'C:\A\Path;C:\B\Path? /:flat';goto '|!attr:r';
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:
Code: Select all
::goto '? /:flat';filter '!attr:r';
I imagine Don will eventually add an attr selector to quick search, but until then hopefully these help you survive.

Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 12:31
by admin
TheQwerty wrote:Unfortunately, it appears to not test folders instead returning them all regardless of their attributes.
Probably "Let folders pass all filters" is ticked...
Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 12:35
by TheQwerty
admin wrote:TheQwerty wrote:Unfortunately, it appears to not test folders instead returning them all regardless of their attributes.
Probably "Let folders pass all filters" is ticked...
Indeed... I forget about those options that are not available anywhere except in the context menu of possibly hidden toolbar buttons.

Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 20:16
by kmccabe
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
Close? That is exactly what I needed!
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
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:
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
That's what I ended up doing.
And how about this for serendipity?
TheQwerty wrote:
Code: Select all
::goto '? /:flat';filter '!attr:r';
Just yesterday I wanted to launch XYplorer with a specific folder and wanted it to come up in Branch View.
I ended up with:
Code: Select all
run XYplorer.exe mypath /script="::#311;"
but now I just learned from you I can use this instead:
Code: Select all
run XYplorer.exe mypath /script="::goto '? /:flat'"
which makes more obvious what I'm doing.
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)
Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 20:38
by admin
Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 20:50
by TheQwerty
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)
This came from a few sources and a rather convoluted path.
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');
Just copy that, go to
Scripting > Run Script, paste it, and hit OK. It will show a small menu of the 4 topics - select one to see the help.

Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 21:02
by admin
Note also these possible usages:
Code: Select all
text "<prop System.FileAttributes>";
Find Files Name:
Re: Show a location in branch view filtered by file attr
Posted: 10 Feb 2015 21:25
by kmccabe
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!
TheQwerty wrote:This came from a few sources and a rather convoluted path.
Do you know how happy that makes me feel to know I didn't miss something trivial and obvious???
Funny how my question ties into another recent conversation. Always amused by how things converge...