Multi Commander > Script

Toggle filter function

(1/2) > >>

matm:
Hello

I would like to have a button that toggle display filter on/off. for this to work, I need to know the state of my filter.
Is there some MC.Explorer.GetViewFilter  that can retrieve the current filter, or a way to test if a certain kind of file is displayed ?

I would expect doing something like that :


--- Code: ---@var $filter = "-*.log"

if ( StrIsEqual({MC.Explorer.GetViewFilter}, $filter))
{
     MC.Explorer.SetViewFilter FILTER={$filter}
}
else
{
    MC.Explorer.SetViewFilter FILTER="*.*"
}

--- End code ---

Is there already some stuff to do that ?

Regards

Mathias (yes, you read well)

matm:
Also, the http://multicommander.com/docs/customcommands_list is empty. Is this expected ?

Mathias (Author):
No there is no "MC.Explorer.GetViewFilter" But sounds like a good idea to add.

I will add that to the next release.


(edit)
After thinking about it, It might not be so easy to fix. This "Custom commands" can not return sometime to the script engine.  Yet.
But I will see if i can figure out a solution for it.

Mathias (Author):
In the latest Beta RC (874)

this can work now.


--- Code: ---@var $filter = "-*.log"
@var $currentFilter;
MC.Explorer.GetViewFilter
$currentFilter = $__CMDRESULT;

if(StrIsEqual($currentFilter, $filter))
{
  MC.Explorer.SetViewFilter FILTER="*.*"
}
else
{
  MC.Explorer.SetViewFilter FILTER={$filter}
}
--- End code ---

matm:
Nice. That's great !

TY

When do you plan the next stable (even a range) ? :)

Navigation

[0] Message Index

[#] Next page

Go to full version