Page 1 of 1
Visual Filters and Variables for Subfolder Name
Posted: 09 Feb 2024 13:51
by GreetingsFromPoland
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.
Re: Visual Filters and Variables for Subfolder Name
Posted: 09 Feb 2024 14:09
by highend
<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
Re: Visual Filters and Variables for Subfolder Name
Posted: 09 Feb 2024 23:00
by GreetingsFromPoland
hi!
<curtab> in a search result? Doesn't make sense at all.
i was trying all the different path-y related entries to see if any would work.
<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...
let's call it a bug so admin can fix it !
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.
Re: Visual Filters and Variables for Subfolder Name
Posted: 09 Feb 2024 23:04
by highend
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); }
Re: Visual Filters and Variables for Subfolder Name
Posted: 10 Feb 2024 01:11
by GreetingsFromPoland
amazing! worked perfectly. allowed me to easily copy 4GB out of the 12GB folders. thank you !
Re: Visual Filters and Variables for Subfolder Name
Posted: 11 Feb 2024 13:57
by eil
highend wrote: ↑09 Feb 2024 23:04
if ($name
LikeI $path . "_*") { $files
.= $fullPath . "\" . $name . <crlf>; }
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.
Re: Visual Filters and Variables for Subfolder Name
Posted: 11 Feb 2024 15:32
by highend
Code: Select all
=> Compound Assignment Operators
rtfm "idh_scripting.htm";
rtfm "idh_scripting.htm#idh_scripting_comparisons";
Re: Visual Filters and Variables for Subfolder Name
Posted: 16 Feb 2024 14:25
by GreetingsFromPoland
hi admin! is there any way that you can take a look at what highend mentions :
<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...
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.
Re: Visual Filters and Variables for Subfolder Name
Posted: 16 Feb 2024 14:44
by admin
Sure, but where does <curfolder> go wrong?
Re: Visual Filters and Variables for Subfolder Name
Posted: 16 Feb 2024 15:16
by GreetingsFromPoland
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.
Re: Visual Filters and Variables for Subfolder Name
Posted: 16 Feb 2024 15:21
by admin
If you want to match filenames you should use name:<curfolder>.png.
But this won't help you in deep search results. <curfolder> does not resolve per item but per list.
Re: Visual Filters and Variables for Subfolder Name
Posted: 16 Feb 2024 16:39
by GreetingsFromPoland
thanks. good to know for future searches.
<curfolder> does not resolve per item but per list.
ok, this is by design. i'm guessing it wouldn't be an easy task to update it to work with per item, right ?
for my previous task, i used highend's script and it did the trick.
Re: Visual Filters and Variables for Subfolder Name
Posted: 16 Feb 2024 16:45
by admin
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