Sync Browse - auto create subfolder

Features wanted...
moritz.glaesle
Posts: 6
Joined: 09 Jun 2021 10:18

Sync Browse - auto create subfolder

Post by moritz.glaesle »

Hi there.
I love the "Sync Browse" feature. Although i miss a way to automatically create a subfolder that i'm diving into, on the other side, if it doesn't exist. i have to first create the folder manually, then can continue sync-browsing. FileZilla has this feature and i use it all the time when just copying single files but keep complex folder structures intact on both sides.

Is this possible? Or is it possible to do via scripting? I'd appreciate any help.

thanks,
Moritz.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Sync Browse - auto create subfolder

Post by highend »

It's possible via a script for Custom Event Actions - Changing Locations - After painting the file list

Set the action to "Run script" and in the script column use this:

Code: Select all

    $syncBrowse = get("#814");
    $dualPane   = get("#800");

    if ($syncBrowse && $dualPane) {
        $aPaneFolders = listpane("a", , 2+4, <crlf>);
        $iPaneFolders = listpane("i", , 2+4, <crlf>);
        $aPaneMissing = formatlist($iPaneFolders, "F", <crlf>, "!$aPaneFolders");
        $iPaneMissing = formatlist($aPaneFolders, "F", <crlf>, "!$iPaneFolders");

        if ($aPaneMissing) {
            $dstPath = get("path", "a");
            foreach($folder, $aPaneMissing, <crlf>, "e") {
                if (exists("$dstPath\$folder") != 2) {
                    new($dstPath . "\" . $folder, "dir");
                    // sysdebug "a: " . $dstPath . "\" . $folder;
                }
            }
            refreshlist "a";
        }
        if ($iPaneMissing) {
            $dstPath = get("path", "i");
            foreach($folder, $iPaneMissing, <crlf>, "e") {
                if (exists("$dstPath\$folder") != 2) {
                    new($dstPath . "\" . $folder, "dir");
                    // sysdebug "i: " . $dstPath . "\" . $folder;
                }
            }
            refreshlist "i";
        }
    }
This should work, although I've done only limited testing...
One of my scripts helped you out? Please donate via Paypal

moritz.glaesle
Posts: 6
Joined: 09 Jun 2021 10:18

Re: Sync Browse - auto create subfolder

Post by moritz.glaesle »

Thanks for the answer!

Although it's not quite what i had in mind. Your script creates all folders that don't exist on the other side after diving into a folder. What i'm looking for is a way to create a folder before i dive into it, if it doesn't exist on either side. Hope this explanation makes sense.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Sync Browse - auto create subfolder

Post by highend »

Nope. Give a real world example
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Sync Browse - auto create subfolder

Post by klownboy »

I'm guessing, but if moritz.glaesle would like only the selected folder in in one pane to be created in the other pane, that might make it easier to script.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

moritz.glaesle
Posts: 6
Joined: 09 Jun 2021 10:18

Re: Sync Browse - auto create subfolder

Post by moritz.glaesle »

real world example:

left pane shows folders A, B, C
right pane shows folders A, B

click on C in left pane to dive into it. before the dive, an empty folder C is created in the right pane, then both panes enter their folder C, so browsing is still in sync. left side shows content of folder C, right pane shows empty folder C.

thanks for your help guys.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Sync Browse - auto create subfolder

Post by admin »

I like and use FileZilla myself, so it cannot be such a bad idea. I checked it and saw that there is a prompt before anything happens:
2021-06-10_180356.png
2021-06-10_180356.png (5.86 KiB) Viewed 1271 times
XYplorer does not need the second option (the disabling part) so it should just ask whether to create the dir, okay?

Or would it be cooler to add a general option: Configuration | Tabs and Panes | Dual Pane | Sync Browse auto-creates any missing folder ?

moritz.glaesle
Posts: 6
Joined: 09 Jun 2021 10:18

Re: Sync Browse - auto create subfolder

Post by moritz.glaesle »

actually i wish filezilla had an option in preferences to turn that dialog off, so it would just create the folder without asking questions. some people might like the warning though.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Sync Browse - auto create subfolder

Post by admin »

So let's do it like I attached it at the end of my post. My preference as well.

Horst
Posts: 1085
Joined: 24 Jan 2021 12:27
Location: Germany

Re: Sync Browse - auto create subfolder

Post by Horst »

admin wrote: 10 Jun 2021 18:06 I like and use FileZilla myself, so it cannot be such a bad idea. I checked it and saw that there is a prompt before anything happens:
2021-06-10_180356.png
XYplorer does not need the second option (the disabling part) so it should just ask whether to create the dir, okay?

Or would it be cooler to add a general option: Configuration | Tabs and Panes | Dual Pane | Sync Browse auto-creates any missing folder ?
I would prefer the question if the missing dir should be created.
Its not a big risk to also have a general option.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Sync Browse - auto create subfolder

Post by admin »

That would make it more complex because there would be three ways (and one checkbox is not enough):
1) just go into that one folder (as it's done now, and I want to keep this option)
2) always create missing folder (new general option)
3) ask each time

moritz.glaesle
Posts: 6
Joined: 09 Jun 2021 10:18

Re: Sync Browse - auto create subfolder

Post by moritz.glaesle »

This would make it a general option "Sync Browse auto-create missing folders" (on/off), with the sub-option "ask before create" (yes/no). sounds good to me. and not too complex.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Sync Browse - auto create subfolder

Post by admin »

moritz.glaesle wrote: 11 Jun 2021 06:05 This would make it a general option "Sync Browse auto-create missing folders" (on/off), with the sub-option "ask before create" (yes/no). sounds good to me. and not too complex.
Not too complex but maybe not too necessary. I assume after you've seen this prompt more than two times you have enough of it and turn it off anyway. And it would have to be a 3-way prompt (not too nice for the brain):
Yes: create
No: don't create but go
Cancel: do nothing

ATM I'd rather keep it as simple as it is now. Sync Browse should be a smooth experience.

eil
Posts: 1617
Joined: 13 Jan 2011 19:44

Re: Sync Browse - auto create subfolder

Post by eil »

i'd say prompt is not needed, but an indicator(smth like a line when filters are used) would be good, 'cause as i understand this sync-view mod works only when in 2 panel mode, so easily can be forgotten to be On if switched to 1 panel and much later again back to 2.
Win 7 SP1 x64 100% 1366x768

Horst
Posts: 1085
Joined: 24 Jan 2021 12:27
Location: Germany

Re: Sync Browse - auto create subfolder

Post by Horst »

eil wrote: 11 Jun 2021 10:16 i'd say prompt is not needed, but an indicator(smth like a line when filters are used) would be good, 'cause as i understand this sync-view mod works only when in 2 panel mode, so easily can be forgotten to be On if switched to 1 panel and much later again back to 2.
I guess most users which are using 2 panes doing that most of the time
and will never forget that they have switched on this feature.
Why should I ever want to switch it off ?
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

Post Reply