XYAHKLiveFilter - livefilter the filelist

Discuss and share scripts and script files...
Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYAHKLiveFilter - livefilter the filelist

Post by Papoulka »

I'd like to be able to dismiss an open filter box simply by clicking on the CTB again. That eliminates having to mouse to the box and press Escape. Presently, re-clicking the CTB opens a second filter box in an odd place.

I'd also prefer not having to type in between the two quotes, which are kind of strange for a search box.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

Papoulka wrote:I'd also prefer not having to type in between the two quotes, which are kind of strange for a search box.
Noted. I am currently working on auto-filling with the current VF and integrating GVF, poking around in the code regions relevant to your suggestion. :kidding:
Papoulka wrote:I'd like to be able to dismiss an open filter box simply by clicking on the CTB again. That eliminates having to mouse to the box and press Escape.
Yes, this has a +1 from myself too! I'm working on it.
Papoulka wrote:Presently, re-clicking the CTB opens a second filter box in an odd place.
Odd. This shouldn't happen. Are you using the latest version? Also what's the CTB script you're using? (right-click the clear button in CTB editor > copy as snippet)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

Papoulka wrote:I'd like to be able to dismiss an open filter box simply by clicking on the CTB again.
I'm trying to get a second click to actually FOCUS the filterbox if it's already opened. Would like this instead?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYAHKLiveFilter - livefilter the filelist

Post by Papoulka »

I'm using v4.2.0, on today's XY 16.30.0001. Windows 7 32-bit.

Setup was a little confusing and I might have it wrong. At this point I have simply copied XYAHKLiveFilter.exe and XYAHKLiveFilter.xys into the XY Scripts folder, and created the CBT button.

The CTB snippet is:

Code: Select all

Snip: CTB 1
  XYplorer 16.30.0001, 2/24/2016 10:25:53 AM
Action
  NewUserButton
Name
  LC: open XYAHKLiveFilter
  ------------------------
  RC: 'Reset' XYAHKLiveFilter
        (if it doesn't open)
Icon
  C:\XYplorer_p\Data\Icons\XYAHKLiveFilter.ico
ScriptL
  perm $p_XYAHKLiveFilter_A, $p_XYAHKLiveFilter_B;
   if ($p_XYAHKLiveFilter_A != 1)||($p_XYAHKLiveFilter_B != <hwnd>){
    $p_XYAHKLiveFilter_A = 1; $p_XYAHKLiveFilter_B = <hwnd>;
    $FocusHotkey = "^`" ; //ex: ^`=CTRL+`, !+'=ALT+SHIFT+', !Space=ALT+SPACE
    $SyncToAB = 1 ; //sync filterbox position with AB
    $ABPadding = 5 ; //not effective if not $SyncToAB = 1
    run trim(<<<#RuncmD
    "<xyscripts>\XYAHKLiveFilter.exe" <hwnd> "$FocusHotkey" "$ABPadding" "$SyncToAB"#RuncmD, "  ", L),, 0;
ScriptR
  "reset"
   filter;unset $p_XYAHKLiveFilter_A,$p_XYAHKLiveFilter_B;ctbstate(0);
  "edit"
   open "<xyscripts>\XYAHKLiveFilter.xys";
FireClick
  0
On LC, the filter box opens and works perfectly - this script is a keeper. On RC I get the script choices of "reset / edit". Multiple LCs just open more filter boxes, all over the place.

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYAHKLiveFilter - livefilter the filelist

Post by Papoulka »

SammaySarkar wrote:
Papoulka wrote:I'd like to be able to dismiss an open filter box simply by clicking on the CTB again.
I'm trying to get a second click to actually FOCUS the filterbox if it's already opened. Would like this instead?
Well, my CBT is right near the filterbox anyway, so clicking on one is no easier or harder than the other. The tiny inconvenience is having to do that AND then press Escape. That's what I wanted to avoid. No big deal. Thanks for the script - this would be a perfect native feature of XY.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

The CTB snippet is: [...]
On LC, the filter box opens and works perfectly - this script is a keeper. On RC I get the script choices of "reset / edit". Multiple LCs just open more filter boxes, all over the place.
Right. Sorry about that. I should update readme.md.
Clear and remove that CTB, and use the snippet given in ctb.md

Code: Select all

Snip: CTB 1
  XYplorer 15.90.0013, 11/8/2015 10:56:37 AM
Action
  NewUserButton
Name
  LC: open XYAHKLiveFilter
  ------------------------
  RC: 'Reset' XYAHKLiveFilter
        (if it doesn't open)
Icon

ScriptL
  $FocusHotkey = "^`" ;/*Ensure this matches associated shortcut!*/ if isset($p_XYAHKLiveFilter_A){sendkeys $FocusHotkey;} else {load "<xyscripts>\XYAHKLiveFilter.CTB.xys";}
ScriptR
  "reset"
   filter;unset $p_XYAHKLiveFilter_A,$p_XYAHKLiveFilter_B;ctbstate(0);
  "edit"
   openwith "notepad",, "<xyscripts>\XYAHKLiveFilter.xys";
FireClick
  0
Does this work?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

Papoulka wrote:
SammaySarkar wrote:
Papoulka wrote:I'd like to be able to dismiss an open filter box simply by clicking on the CTB again.
I'm trying to get a second click to actually FOCUS the filterbox if it's already opened. Would like this instead?
Well, my CBT is right near the filterbox anyway, so clicking on one is no easier or harder than the other. The tiny inconvenience is having to do that AND then press Escape. That's what I wanted to avoid. No big deal. Thanks for the script - this would be a perfect native feature of XY.
This is actually far easier than what I'm currently trying to do (many issues: ctb clicks only focus some of the time, or the editbox's caret doesn't go away etc).
But how would you refocus the filterbox then? Is it easier to use the hotkey/mouse instead of a ctb click?
OK this matches XY's regular button action behavior. I'll add this feature.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYAHKLiveFilter - livefilter the filelist

Post by Papoulka »

FYI, experimenting with searching for various files... many of mine have a semicolon in their names. Without consulting VF rules I just started typing
  • ";
within the existing quotes, at which point the livefilter script crashed. This may be harder to fix than it's worth; just noting it here.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

Papoulka wrote:I just started typing

Code: Select all

";
within the existing quotes, at which point the livefilter script crashed. This may be harder to fix than it's worth; just noting it here.
Nope, I just get a XY scripting error. You can close that and continue typing (correctly!). Its not just hard to fix, its impossible to fix. You, as a user, have to ensure your filter pattern is syntactically correct. 8)

Did my snippet above fix your other problem: "Multiple LCs just open more filter boxes, all over the place." ?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYAHKLiveFilter - livefilter the filelist

Post by Papoulka »

Yes; now a second LC does nothing.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

Great, thanks for the feeback. I'll make an interim 4.2.1 maintenance release to publish the updated procedure.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

v5.0.0b
So much under the hood improvements, that your subconscious will throw a party! :mrgreen: 8)
  • New features
  • Simplified install. Just extract+overwrite, and use ::load "xyahklivefilter.xys"; to call everywhere: no separate scripts for CTB.
    (For best results, recommend a clean install. Delete all older XYAHKLiveFilter files, CTBs and other calling scripts.)
  • Reuses existing visual filter.
  • Removed default quotes from filterbox.
  • Choice of enclosing the pattern in single or double quotes. The pattern is escaped, so you don't have to type two quotes.
  • Added customizable 2nd-click action, separately customizable for CTB.
    So, you can run the filter using any method, and another click will focus or close it, depending on your setup.
  • (hopefully) better documentation.
The beta tag is because some issues exist, and I need to make the doc more user-friendly.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYAHKLiveFilter - livefilter the filelist

Post by Papoulka »

Now it looks and acts like a native function - very slick. Thanks.

klownboy
Posts: 4377
Joined: 28 Feb 2012 19:27
Location: Windows 11, 24H2 Build 26100.4770 at 100% 2560x1440

Re: XYAHKLiveFilter - livefilter the filelist

Post by klownboy »

Very nice Sammay. I finally got a chance to run your latest version. Works great! :appl:

Maybe this is covered in an option in the XYS file, but I didn't see it. Believe it or not, I'm one who doesn't always have the AB on, so I when I run the script from a CTB, the AB pops up along with XYAHKLiveFilter which is exactly what I want, but it would be nice if the script knew when the AB was not on when it was initially run, so when you hit escape to close XYAHKLiveFilter, the AB would also be closed (or possibly an option). Right now for me anyway, when ESC is hit the XYAHKLiveFilter box goes away, but the AB is left remaining. Any chance that could be worked in or maybe it already exists? Thanks.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XYAHKLiveFilter - livefilter the filelist

Post by bdeshi »

hmm, hmm, it is supposed to auto-close the AB. :bug: Will release a fix.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply