switching selected files view under branch view

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

switching selected files view under branch view

Post by sweet40 »

how do i get a switch of views between selected only, non-selected and all items, when in branch view? any script-gifted user could fetch us a solution, please?

script command 'filter' seems to not work properly when in branch view, leading me to believe it's a bug.

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: switching selected files view under branch view

Post by sweet40 »

not possible?
:cry:

FluxTorpedoe
Posts: 906
Joined: 05 Oct 2011 13:15

Re: switching selected files view under branch view

Post by FluxTorpedoe »

Hi'
If I understand you correctly, by using Branch View then filter, you want to have a filtered view showing specific items that belong to different folders?
If so, unfortunately, it's not possible out-of-the-box.

But since it's kind of a virtual folder, there's a workaround.
One way to achieve this is to "mark" your files, then make a search on them (and ideally, have this automated).

Here's a link to a script I made, called "Buffer" which does just that.
You can add any item you want into that buffer from any kind of view, Branch View included (they're just tagged in reality). Then you can open the Buffer to see its content, and add or remove other items to it.
The script and explanations can be found here.

Since it wasn't much documented, don't hesitate to ask.

Hope this helps, 8)
Flux

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: switching selected files view under branch view

Post by sweet40 »

Hi FluxTorpedoe!
No, no. When in branch view mode I´d like to be able to select random items and have only them displayed in list, with a click have eveything else listed and with a 3rd click, toggle to full branch view as it were in the initial state.

Anyway, later i´ll check your script and post a feedback if it matches my request in any way. Thanks for replying!

highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: switching selected files view under branch view

Post by highend »

Code: Select all

    perm $FILTER_STATUS;
    $selectedItems = get("selectedItemsNames", ";");
    $itemCount = gettoken($selectedItems, "count", ";");

    if ($FILTER_STATUS == "") {
        $FILTER_STATUS = "none";
    }

    if ($FILTER_STATUS == "none") {
        if ($itemCount >= 1) {
            filter "$selectedItems", 1;
            $FILTER_STATUS = "included";
        } else {
            status "Select one or more files before you try to apply a filter!", "FF0000", "alert";
            end(true);
        }
    } elseif ($FILTER_STATUS == "included") {
        if ($itemCount < 1) {
            sel "a";
            $selectedItems = get("selectedItemsNames", ";");
        }
        filter "!$selectedItems", 1;
        $FILTER_STATUS = "excluded";
    } elseif ($FILTER_STATUS == "excluded") {
        filter;
        $FILTER_STATUS = "none";
    }
This doesn't take into account files in different folder structures!
Which means: If you select the file "Temp.zip" and it exists in two different folders in your branched view, the script will filter all occurences of this file...
One of my scripts helped you out? Please donate via Paypal

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: switching selected files view under branch view

Post by sweet40 »

To FluxTorpedoe:
nice nick!
=)
Your script works wonders. But to make it sharp, why haven't you incorporated an option so label '|buffer|' is created after prompting user? A quick search and some thinking revealed this is not possible but I'm sure I'm missing something here.

Enternal script only pops a "Command 'load' called with empty 'resource' argument" warning. :?

To highend: your script loses the ability to toggle back to state 1 on 3rd execution when I start from a branch view mode, but works fine when started from regular list mode. Can this be enhanced?

highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: switching selected files view under branch view

Post by highend »

state 1 = no filtering?

If you use branch mode with folders visible, try to change
sel "a";
to
sel "f";

otherwise show 4 screenshots.
1. normal branch view
2-4. after invoking the script
One of my scripts helped you out? Please donate via Paypal

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: switching selected files view under branch view

Post by sweet40 »

To highend: sel 'a' worked, so thank you!

To anyone reading this: it seems there's no way, using scripting, to retrieve all tags, labels and comments a file have, right? It should: so a bunch of files could be filtered and if they match a specified criteria a given action could be performed on them. Again I have the feeling that I am missing something here as this is so obvious I'm wondering why it's not featured yet given the depth the current set of tag-related features have.

And a more specific one: why would I be able to apply labels which can be customized, but I am a) not allowed to retrieve a list of actual labels, a.1) even because they're limited to 15 so a correspondence 1 - label A, 7 - label G, 15 - label P would be possible, and b) limited to apply only labels that are already set via configuration screen, ie, they cannot be customized (defeats the purpose, eh?) unless this will break a script?

It sounds confuse so let's summarize like this:
There should be a (few) script command(s) which could:
1. retrieve tags/labels/comments/all 3 of an item so the user has the option to keep existent or change 'A' for 'C' if retrieved are 'AB' - being 'A' a search tag/label/comment term to be replaced with 'C';
2. attribute labels according to a correspondence table. Such table should be built using a script command which reads the proper source (one of those xyplorer .dat files?) and delivers current values in a 'position (1-15) - RGB value - custom name' format, allowing any necessary changes, of course.

highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: switching selected files view under branch view

Post by highend »

it seems there's no way, using scripting, to retrieve all tags, labels and comments a file have, right?
In general: wrong.

report() and folderreport() allow the use of templates to get all those items...
One of my scripts helped you out? Please donate via Paypal

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: switching selected files view under branch view

Post by sweet40 »

Thanks for the tip, highend.

FluxTorpedoe
Posts: 906
Joined: 05 Oct 2011 13:15

Re: switching selected files view under branch view

Post by FluxTorpedoe »

Hi
Sorry it's been a while, but I'll try to answer anyway... :)
sweet40 wrote:To FluxTorpedoe:nice nick!=)
Your script works wonders. But to make it sharp, why haven't you incorporated an option so label '|buffer|' is created after prompting user?
- Thanks ;)
- This script was an "internal" use, and I had first posted it in the context of a discussion in case it may be of some help. One way or the other I could definitely improve it for "mainstrem" use if there's need for it!

Post Reply