Filter to show videos & folders

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
TehFonz
Member
Member
Posts: 12
Joined: 2012 Aug 15, 04:12

Filter to show videos & folders

Post by TehFonz »

I am trying to create a visual filter to only show videos AND folders.
Can anyone point me in the right direction?
Cheers
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

you can use OR rules for that, so make a rule on NAME and a rule on ATTRIBUTES, the name would contain all video extensions like *.wmv, *.avi etc (separated by commas) and the attributes rule would include D for directory. Make them both (boolean) OR and it should work

an easier way could be to use the folder tree for folders and the contents pane (right) for videos
TehFonz
Member
Member
Posts: 12
Joined: 2012 Aug 15, 04:12

Post by TehFonz »

That worked a treat. Now can I add that predefined filter to the tool bar???
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

there is no clean way to add this but some of the script guys can help you. The idea is that you must save this filter with a name and then type its name as a quicksearch filter in the addressbar:

Code: Select all

: {dirsAndVideo}
(note leading colon : and curly braces)
then pressing shift+enter will apply this hyperfilter.
TehFonz
Member
Member
Posts: 12
Joined: 2012 Aug 15, 04:12

Post by TehFonz »

OK excellent I got the Quick Search filter function working, now to either bind that to a keyboard shortcut or create an Icon in the toolbar. preferably both. Anyone able to help with that?
Kilmatead
Platinum Member
Platinum Member
Posts: 4580
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

If you download this (as ever, source code included for the security conscious) and create a User Command like this:

> x2Filter.exe "FilterName"

...you may then put that user command in a toolbar or attach a shortcut key to it.  Note that "FilterName" should be whatever the name you saved your filter to, and that the x2 AddressBar (View -> Toolbars -> Address bar) must be visible.

Caveat: For some reason (unrelated to this script) my machine isn't very happy using the :{nnn} method nikos explained above - I'm attempting to find the source of this, but it's eluding me.  So until we get to the bottom of that, it's a little difficult for me to ensure this script works perfectly - please report any weirdness.  We soldier on, inevitably. :shrug:
TehFonz
Member
Member
Posts: 12
Joined: 2012 Aug 15, 04:12

Post by TehFonz »

OK,
I'm using the script you were very kind enough to write, and have set up a user command to activate the filter. It works. The first time. After turning the filter off, and back on again x2 crashes :(.
When it comes back up the user command works for the 1st time and then crashes the 2nd time.
Not sure why.
Also I have put the x2Filter.exe in the x2 program files folder just for neatness.
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

can you try doing the filter manually (typing in the addressbar) twice and see if xplorer2 crashes too? Are you on 64 bit windows?
TehFonz
Member
Member
Posts: 12
Joined: 2012 Aug 15, 04:12

Post by TehFonz »

Yes typing the filter in as a quick search crashes after the second time typing it in.
Windows 8 64Bit
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

ok, nice bug there, I will repair it for the next release
TehFonz
Member
Member
Posts: 12
Joined: 2012 Aug 15, 04:12

Post by TehFonz »

Awesome, thank you!!
User avatar
the mechanic
Member
Member
Posts: 36
Joined: 2005 Mar 30, 18:48
Location: MN

Post by the mechanic »

Kilmatead wrote:If you download this (as ever, source code included for the security conscious) and create a User Command like this:

> x2Filter.exe "FilterName"

...you may then put that user command in a toolbar or attach a shortcut key to it.  Note that "FilterName" should be whatever the name you saved your filter to, and that the x2 AddressBar (View -> Toolbars -> Address bar) must be visible.

Caveat: For some reason (unrelated to this script) my machine isn't very happy using the :{nnn} method nikos explained above - I'm attempting to find the source of this, but it's eluding me.  So until we get to the bottom of that, it's a little difficult for me to ensure this script works perfectly - please report any weirdness.  We soldier on, inevitably. :shrug:
OK, I copied the X2Filter.exe to the program directory.  Then, as instructed I created a user command

> x2Filter.exe "FilterName"

When I execute the command in the address bar it replaces the command with

:{within one month}

then I have to hit enter to get it to filter.  Seems reasonable I guess.

When I create a user command I put in the same stuff and when I select it, it places

:{within one month}

in the toolbar again and I have to hit Enter?  What do I need to do to get the command just to set the filter?

Secondly, why is it if I create a user filter in pane one and go over to pane two it does not appear?  Don't tell me I have to create each and every filter twice, once for each pane???
mechanic
Kilmatead
Platinum Member
Platinum Member
Posts: 4580
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

If you run x2filter from a user-command, it will hit <Enter> for you, so you should only need to click the button to apply. Unfortunately this kind of filter button can't be used to "toggle" - you still need to use <Ctrl+J> to disable the filter, or select another.  (As described above, there used to be a bug in x2 related to repeatedly applying filters this way - I don't know if Nikos fixed that in the most recent Pro version or not - it is fixed in the most recent Ultimate version.  That might be the source of your difficulty.)

Applying a Filter only sets it to the active pane - to apply it to both you either need to hit <Ctrl+Alt+M> or hit <Tab> to change the pane, and apply the filter again.

The script above could be easily modified to send the <Ctrl+Alt+M> command automatically, perhaps conditionally on the <Alt> key being held down when the button is clicked, as that's the usual convention for applying things to the alternate pane.

I'd suggest first we verify if this bug was actually fixed in the current Pro version or not - Nikos?
User avatar
the mechanic
Member
Member
Posts: 36
Joined: 2005 Mar 30, 18:48
Location: MN

Post by the mechanic »

I do have the Ultimate version, and when I run the command from a user-command it does not hit Enter for me.  Of course, I am quite sure that I am doing something wrong if my track record is any indication.  :-/
-mechanic
mechanic
Kilmatead
Platinum Member
Platinum Member
Posts: 4580
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Hmm... odd that it doesn't work for you - please try this version to see if it works a little better (the <Shift><Enter> is sent as a separate means).  I also added (as a test, mainly) the application of the filter to both panes when the <Alt> key is held down when clicking the button (though this has the wacky side-effect of clearing the status-bar, so ignore that bit).  Please report any weirdness.  Or, indeed, successes. :?
Post Reply