(Almost) Live Filter

Discuss and share scripts and script files...
Post Reply
Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

(Almost) Live Filter

Post by Marco »

"If Mohammed will not go to the mountain, the mountain must come to Mohammed"

Just a very simple code to bring List content somewhere where Live Filter is available.
Multiple selections are possible via checkboxes.
Smartness: if you select only one item you most likely want to open it. Otherwise, the List is just filtered, and further actions are up to you.
Works everywhere.

Code: Select all

 global $items = inputselect( , report("{FullName}<crlf>"), "<crlf>", 67, , "80%", "80%", "(Almost) Live Filter - " . tab("get", "term"));

 if ($items UnLike "*<crlf>*") {
  sub "_Open";
 } else {
  sub "_VF"
 };

"_Open"

 global $items;

 open "$items";

"_VF"

 global $items;

 $visual_filter = "";
 foreach ($item, "$items", "<crlf>");
  $visual_filter = "$visual_filter" . quote(getpathcomponent("$item", "file")) . "|";
 };
 filter '"(Almost) Live Filter" ' . trim("$visual_filter", "|");

 #250; //select all
Last edited by Marco on 31 Jul 2014 15:49, edited 1 time in total.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: (Almost) Live Filter

Post by SkyFrontier »

Haha, nice one, Marco!

Except that all boxes should be pre-checked. As if they are liveFiltered, makes sense that everything visible will make into final selection.
Nah. Same problem I had with a previews script, Don's aware of...

Thanks!

Suggestions:
-use "filter;" as first line, thus removing previous filter;
-

Code: Select all

 filter '"(Almost) Live Filter "' . trim("$visual_filter", "|");
could be

Code: Select all

 filter trim("$visual_filter", "|");
as that title tries to make into the filtering terms itself.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: (Almost) Live Filter

Post by Marco »

You're welcome!

- the idea is to filter what is visible in the list, that's why I use report and not folderreport. Removing any previous VF would be against this logic.
- fixed, just a matter of moving the double quotes one position on the left!
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Post Reply