Visual Filters and Variables for Subfolder Name
-
GreetingsFromPoland
- Posts: 284
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Visual Filters and Variables for Subfolder Name
hi! i have a folder and file structure like this :
\Artwork\(subfolder)\(subfolder)_marquee.png
\Artwork\(subfolder)\(subfolder)_cpo.png
\Artwork\(subfolder)\otherfile.png
\Artwork\(subfolder)\anotherfile.png
for example,
\Artwork\dkong\dkong_marquee.png
basically inside of each subfolder there are several files that match "subfolder name" + "_*.png". there are tons of other files in there, but i'm trying to select only the ones that match the name of the subfolder with the underscore.
i start in the \Artwork folder and do a *.png search and get everything in Search Results (i see the Path column there as well). i tried setting the Visual Filter to <curtab> but that didn't work (it did work if i was inside of a folder and started a search, but not at the root).
next i tried path:<curtab> and that didn't work either.
within the Search Results tab, is it possible to filter just the files that match "the name of the folder it's in" then i can add "_*.png" to it ?
i'm still going through the help file sections for XY Variables and Visual Filters to see if i can find something. i love using the Search Results because i can use the awesome Rich Copy to recreate the structure when i copy/move the files to a different location.
\Artwork\(subfolder)\(subfolder)_marquee.png
\Artwork\(subfolder)\(subfolder)_cpo.png
\Artwork\(subfolder)\otherfile.png
\Artwork\(subfolder)\anotherfile.png
for example,
\Artwork\dkong\dkong_marquee.png
basically inside of each subfolder there are several files that match "subfolder name" + "_*.png". there are tons of other files in there, but i'm trying to select only the ones that match the name of the subfolder with the underscore.
i start in the \Artwork folder and do a *.png search and get everything in Search Results (i see the Path column there as well). i tried setting the Visual Filter to <curtab> but that didn't work (it did work if i was inside of a folder and started a search, but not at the root).
next i tried path:<curtab> and that didn't work either.
within the Search Results tab, is it possible to filter just the files that match "the name of the folder it's in" then i can add "_*.png" to it ?
i'm still going through the help file sections for XY Variables and Visual Filters to see if i can find something. i love using the Search Results because i can use the awesome Rich Copy to recreate the structure when i copy/move the files to a different location.
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Visual Filters and Variables for Subfolder Name
<curtab> in a search result? Doesn't make sense at all.
<curfolder> would come close but for whatever reason it doesn't display the correct result for an entry
Don't know if this is just a bug or by design...
Scripting it would be probably the only solution
<curfolder> would come close but for whatever reason it doesn't display the correct result for an entry
Don't know if this is just a bug or by design...
Scripting it would be probably the only solution
One of my scripts helped you out? Please donate via Paypal
-
GreetingsFromPoland
- Posts: 284
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Re: Visual Filters and Variables for Subfolder Name
hi!
when looking at the help, there are SO MANY options for Visual Filters, surely getting just the folder name of the item would have to be included.
i was trying all the different path-y related entries to see if any would work.<curtab> in a search result? Doesn't make sense at all.
let's call it a bug so admin can fix it !<curfolder> would come close but for whatever reason it doesn't display the correct result for an entry
Don't know if this is just a bug or by design...
when looking at the help, there are SO MANY options for Visual Filters, surely getting just the folder name of the item would have to be included.
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Visual Filters and Variables for Subfolder Name
Even without a vf it's incredible easy to script...
Code: Select all
$report = report("{fullpath}|{name}<crlf>");
$files = "";
foreach($item, $report, <crlf>, "e") {
$fullPath = gettoken($item, 1, "|");
$path = gettoken($fullPath, -1, "\");
$name = gettoken($item, 2, "|");
if ($name LikeI $path . "_*") { $files .= $fullPath . "\" . $name . <crlf>; }
}
if ($files) { paperfolder("Result", $files); }
One of my scripts helped you out? Please donate via Paypal
-
GreetingsFromPoland
- Posts: 284
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Re: Visual Filters and Variables for Subfolder Name
amazing! worked perfectly. allowed me to easily copy 4GB out of the 12GB folders. thank you !
-
eil
- Posts: 1864
- Joined: 13 Jan 2011 19:44
Re: Visual Filters and Variables for Subfolder Name
Can you please explain marked commands?
I presume .= means "add the next data to end of variable's content", but i don't seem to ever see LikeI command.
Win 7 SP1 x64 100% 1366x768|1900x1080
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Visual Filters and Variables for Subfolder Name
Code: Select all
=> Compound Assignment Operators
rtfm "idh_scripting.htm";
rtfm "idh_scripting.htm#idh_scripting_comparisons";
One of my scripts helped you out? Please donate via Paypal
-
GreetingsFromPoland
- Posts: 284
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Re: Visual Filters and Variables for Subfolder Name
hi admin! is there any way that you can take a look at what highend mentions :
i have been able to use his script without any problems. would like to hear your input if this is a potential bug or not (when using the variables.<curfolder> would come close but for whatever reason it doesn't display the correct result for an entry
Don't know if this is just a bug or by design...
-
admin
- Site Admin
- Posts: 66094
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Visual Filters and Variables for Subfolder Name
Sure, but where does <curfolder> go wrong?
FAQ | XY News RSS | XY X
-
GreetingsFromPoland
- Posts: 284
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Re: Visual Filters and Variables for Subfolder Name
i was trying to use the path: name (shown in the results) as part of the visual filter. something like this : path:<curfolder>.png; but i can't get anything to match the path name that is shown.
example folder structure :
\artwork\dkong
\artwork\frogger
\artwork\mspacman
for example, searching for *.png would give me something like this :
(these are from the dkong subfolder and the Path column shows dkong)
dkong.png
dkong_marquee.png
dkong_flyer.png
(these are from the frogger subfolder and the Path column shows frogger)
frogger.png
frogger_cpanel.png
frogger_cabinet.png
(etc)
then on the Search results tab, i would use path:<curfolder>.png as the Visual Filter and hopefully only see :
dkong.png
frogger.png
since the file name matches the path + .png.
i'm probably doing it wrong, but i can't seem to use the result of Path in any filter. i've tried several XY variables in the filter.
example folder structure :
\artwork\dkong
\artwork\frogger
\artwork\mspacman
for example, searching for *.png would give me something like this :
(these are from the dkong subfolder and the Path column shows dkong)
dkong.png
dkong_marquee.png
dkong_flyer.png
(these are from the frogger subfolder and the Path column shows frogger)
frogger.png
frogger_cpanel.png
frogger_cabinet.png
(etc)
then on the Search results tab, i would use path:<curfolder>.png as the Visual Filter and hopefully only see :
dkong.png
frogger.png
since the file name matches the path + .png.
i'm probably doing it wrong, but i can't seem to use the result of Path in any filter. i've tried several XY variables in the filter.
-
admin
- Site Admin
- Posts: 66094
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Visual Filters and Variables for Subfolder Name
If you want to match filenames you should use
But this won't help you in deep search results. <curfolder> does not resolve per item but per list.
name:<curfolder>.png.But this won't help you in deep search results. <curfolder> does not resolve per item but per list.
FAQ | XY News RSS | XY X
-
GreetingsFromPoland
- Posts: 284
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Re: Visual Filters and Variables for Subfolder Name
thanks. good to know for future searches.
for my previous task, i used highend's script and it did the trick.
ok, this is by design. i'm guessing it wouldn't be an easy task to update it to work with per item, right ?<curfolder> does not resolve per item but per list.
for my previous task, i used highend's script and it did the trick.
-
admin
- Site Admin
- Posts: 66094
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Visual Filters and Variables for Subfolder Name
Per-item variables?* No, that would be overkill. Such things are better handled by scripting.
* we have them, but only in the special context of custom columns
* we have them, but only in the special context of custom columns
FAQ | XY News RSS | XY X
XYplorer Beta Club