"create new folder" with predefined name from existing folder ??

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
frany
Posts: 7
Joined: 27 Mar 2022 12:12

"create new folder" with predefined name from existing folder ??

Post by frany »

For creating a new folder XY provides quite some options.
Nevertheless I really miss one feature (which in my early days of using NC was extremly handy):

The name of the marked folder (in the folder list / tree of a pane) should be used as the name for the newly created folder (via e.g. CTRL+N) instead of the usual "New Folder" ("Neuer Ordner").

Very often I just need to change a detail in the wording of the foldername and I am done.
In the current setting I need to completely type the new name, or do an additional copy/paste from the other folder name.

I thought to ask here if someone had that issue and found a solution before I go to the "wishes" section.

And yes, I tried my best to search the forums before I asked (and I am not good at coding, to try my own bypass).

Thanks!
XYplorer 24.10 / Win 11 Pro x64

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

Re: "create new folder" with predefined name from existing folder ??

Post by highend »

Remove CTRL+N from "New Folder" in Menu - Tools - Customize Keyboard Shortcuts
1.png
1.png (14.54 KiB) Viewed 711 times
Menu - User - Manage Commands...

Category: Run Script
Create a new entry
Caption: New folder
Script: (Use the "Edit..." button)

Code: Select all

    $default = "Neuer Ordner";

    $focus = <get focusedcontrol>;
    if     ($focus == "T") { $folderName = <curfolder>; }
    elseif ($focus == "L") {
        if (exists(<curitem>) != 2) { $folderName = $default;  }
        else                        { $folderName = <curname>; }
    }
    $new = input("Enter new folder name...", , $folderName, "e", 8:=":newfolder");

    end (!trim($new)), "Can't create an empty folder name, aborted!";
    end (exists($new) == 2), "A folder with that name already exists, aborted!";

    new($new, "dir");
After clicking OK in the "Edit Script" window, click on "Assign Keyboard Shortcut..." and assign... CTRL+N
2.png
2.png (12.39 KiB) Viewed 711 times
One of my scripts helped you out? Please donate via Paypal

frany
Posts: 7
Joined: 27 Mar 2022 12:12

Re: "create new folder" with predefined name from existing folder ??

Post by frany »

well, this is something .... Working.
you made my day! and these steps give me ideas :)
THANKS highend!
XYplorer 24.10 / Win 11 Pro x64

Post Reply