Is there a menu operation for saving different sets of filters for a tab? If not, would a single-line script for each filter be able to be saved in the Catalog?
I use a catalog to hold a simple script to toggle thumbnails (::#302) and I'm guessing I can stash filters in the same way.
I tested ::#354. That's sort of okay, as I can click the down-arrow to recall other filters. Is this the best way?
Ideally, I would have a catalog item that applies a specific filter.
Save Filters As Collection
Re: Save Filters As Collection
You could write a script that saves the current configuration to a temp .ini file, read the mruVisualFilter section from it and e.g. display its entries as a popup menu.
That would only be one entry in the catalog.
E.g.:
That would only be one entry in the catalog.
E.g.:
Code: Select all
$tmpIni = "%TEMP%\~XY.ini";
savesettings 1, $tmpIni;
$vFilters = regexreplace(gettoken(getsectionlist("mruVisualFilter", $tmpIni), 2, <crlf>, "t", 2), "(^\d+=[""]|[""]$)");
$selection = popupmenu($vFilters, 7:="<:::>"); // Arbitrary item separator to not break a filter containing ";"
if ($selection) { filter $selection, 1+4; }
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 15
- Joined: 25 May 2015 21:26
Re: Save Filters As Collection
Thanks highend, this looks promising.
Cheers,
Mitch
Cheers,
Mitch
-
- Posts: 15
- Joined: 25 May 2015 21:26
Re: Save Filters As Collection
What am I doing wrong?
I was reading through Stefan's scripting manual and tried creating this Catalog entry as
Cheers,
Mitch
::load "C:\Users\MA\AppData\Roaming\XYplorer\Scripts\filterview";
I was reading through Stefan's scripting manual and tried creating this Catalog entry as
::load "filterview";
Cheers,
Mitch
Re: Save Filters As Collection
Show a picture of the properties of that entry
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 15
- Joined: 25 May 2015 21:26
Re: Save Filters As Collection
For the time being, I'm just using ::#354; which simulates Ctl+J.
Is that what your script does, as well?
Here is the catalog property which attempts to call your script. I should note that I added a name to the script. Was that necessary? Did I do it properly?
Is that what your script does, as well?
Here is the catalog property which attempts to call your script. I should note that I added a name to the script. Was that necessary? Did I do it properly?
Code: Select all
"filterview"
$tmpIni = "%TEMP%\~XY.ini";
savesettings 1, $tmpIni;
$vFilters = regexreplace(gettoken(getsectionlist("mruVisualFilter", $tmpIni), 2, <crlf>, "t", 2), "(^\d+=[""]|[""]$)");
$selection = popupmenu($vFilters, 7:="<:::>"); // Arbitrary item separator to not break a filter containing ";"
if ($selection) { filter $selection, 1+4; }
- Attachments
-
- tabfilter-in-catalog.png (17.78 KiB) Viewed 2153 times
Last edited by highend on 05 May 2020 14:32, edited 1 time in total.
Reason: code tags instead of inline code -> Unreadable without correct line breaks
Reason: code tags instead of inline code -> Unreadable without correct line breaks
Re: Save Filters As Collection
Using my script requires one click less than #354;
If this doesn't matter you can also use #354; instead.
My script doesn't require a name it works as it is.
I don't know what happens when you execute the catalog entry. Does it present an error message?
You don't need the full path to a script as long as it is in <xyscripts> folder (which seems to be the case).
So you've created a file named
and copied the script I've posted 1:1 into it?
If you're not sure if the script is executed at all, remove the name at the top of it (that you've added)
and use e.g. a
If this doesn't matter you can also use #354; instead.
My script doesn't require a name it works as it is.
I don't know what happens when you execute the catalog entry. Does it present an error message?
You don't need the full path to a script as long as it is in <xyscripts> folder (which seems to be the case).
So you've created a file named
C:\Users\MA\AppData\Roaming\XYplorer\Scripts\filterview.xys
?and copied the script I've posted 1:1 into it?
If you're not sure if the script is executed at all, remove the name at the top of it (that you've added)
and use e.g. a
text "hi";
instead...One of my scripts helped you out? Please donate via Paypal
-
- Posts: 15
- Joined: 25 May 2015 21:26
Re: Save Filters As Collection
It worked! I started from the beginning. I see how your script saves a step. That is very cool.
Thanks for your help!
Cheers,
Mitch
Thanks for your help!
Cheers,
Mitch
- Attachments
-
- tabfilter-in-catalog-working.png (371.14 KiB) Viewed 2132 times
Re: Save Filters As Collection
No problem and thanks a bunch for the donation
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 15
- Joined: 25 May 2015 21:26
Re: Save Filters As Collection
My pleasure, highend!
FYI, both your script and #354 work hand in hand to speed up things. I use the Ctl-J when I need to create a new filter or to clean up the existing one. Of course, then I use your script to quickly select among them.
Cheers,
Mitch
FYI, both your script and #354 work hand in hand to speed up things. I use the Ctl-J when I need to create a new filter or to clean up the existing one. Of course, then I use your script to quickly select among them.
Cheers,
Mitch
Re: Save Filters As Collection
That sounds like the perfect way to handle this!
One of my scripts helped you out? Please donate via Paypal