Create Directory with Multiple subs?

Discuss and share scripts and script files...
fuego126
Posts: 6
Joined: 25 May 2019 23:50

Create Directory with Multiple subs?

Post by fuego126 »

Hi.. .wondering if someone can lead me down the right path.... I want to create a button that will:

a) ask the user for a folder name (ie: Marybeth) And then
1 - create the folder in a specific path (ie: G:\clients\Marybeth)
2 - change to that new directory and create 3 fixed subdirectories (ie: G:\clients\Marybeth\Images, \Text, \Previews)

Thus, at the end of the click, there would be a new G:\clients folder with the 3 subfolders.... I got part way into this but not any further. Thx!

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

Re: Create Directory with Multiple subs?

Post by highend »

And your "part way" looks like?...
One of my scripts helped you out? Please donate via Paypal

fuego126
Posts: 6
Joined: 25 May 2019 23:50

Re: Create Directory with Multiple subs?

Post by fuego126 »

I was able to get the input box to appear and create the new folder....

Code: Select all

input $name, "Enter the name of the new folder to create";
 new "<curpath>\$name", dir;
But - I was not able to force it to a specific path (ie: G:\clients) nor could I find the chg directory command... thx for your advice!

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

Re: Create Directory with Multiple subs?

Post by highend »

This is way off...

Code: Select all

    $dstPath = "R:\test";
    $subFolders = "Images|Text|Previews";

    $folderName = input("Enter the desired folder name");
    if ($folderName) {
        foreach($subFolder, $subFolders, , "e") {
            new("$dstPath\$folderName\$subFolder", "dir");
        }
        goto "$dstPath\$folderName";
    }
One of my scripts helped you out? Please donate via Paypal

fuego126
Posts: 6
Joined: 25 May 2019 23:50

Re: Create Directory with Multiple subs?

Post by fuego126 »

Thx HighEnd... that did the trick. Appreciate the time..... :beer:

galtar53
Posts: 18
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 »

bonjour,
je veux créer plusieur répertoire suivant une liste connue, et à l'interieur de c'est répertoire je veux faire des sous dossiers spécifique.
CORDIALEMENT

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Create Directory with Multiple subs?

Post by RalphM »

Welcome to the forum.
As the number of French speaking forum members is certainly less than the English speaking ones, you will get more replies if you manage to post in English.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

galtar53
Posts: 18
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 »

RalphM wrote: 21 Jun 2020 17:11 Welcome to the forum.
As the number of French speaking forum members is certainly less than the English speaking ones, you will get more replies if you manage to post in English.
Ok Thanks

I want a lisp to create several directories according to a known list, and inside this directory I want to make specific sub-folders.
thank you

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

Re: Create Directory with Multiple subs?

Post by highend »

Menu - Edit - New - New Folders?
One of my scripts helped you out? Please donate via Paypal

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Create Directory with Multiple subs?

Post by RalphM »

Check out the script above by highend and adapt it to your needs.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

galtar53
Posts: 18
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 »

RalphM wrote: 22 Jun 2020 03:37 Check out the script above by highend and adapt it to your needs.

but the problem is how to make several directories, the script gives me only one directory to do, because I have a list of directories, and I want to do it once without starting the script each time to do one directory.

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

Re: Create Directory with Multiple subs?

Post by highend »

Maybe you provide an excerpt of folders including their subfolders you want to create?
One of my scripts helped you out? Please donate via Paypal

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: Create Directory with Multiple subs?

Post by kotlmg »

highend wrote: 26 May 2019 00:27 This is way off...

Code: Select all

    $dstPath = "R:\test";
    $subFolders = "Images|Text|Previews";

    $folderName = input("Enter the desired folder name");
    if ($folderName) {
        foreach($subFolder, $subFolders, , "e") {
            new("$dstPath\$folderName\$subFolder", "dir");
        }
        goto "$dstPath\$folderName";
    }
hello highend,
1. is it possible to name subfolders as folder with yeasteday, folder with today and folder with tomorrow date? i.e 2020-06-21, 2020-06-22, 2020-06-23. folder names to change dynamically.
2. i want a new folder with today's date to be created in the above folder path automatically and daily. the moment i start xyplorer, folder with todays date to be created.

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

Re: Create Directory with Multiple subs?

Post by highend »

Sure, look at datediff()/ formatdate() and the date variable...
One of my scripts helped you out? Please donate via Paypal

galtar53
Posts: 18
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 »

highend wrote: 22 Jun 2020 13:31 Maybe you provide an excerpt of folders including their subfolders you want to create?
see the attached file
for example :
I) parent file: P18943
1) Sub-folder 1: "Enquête Parcellaire"
2) Subfolder 2: "Enquête Juridique".
moreover I want to drag files which have the same prefix as the Parent folder, in the sub-folder created "Enquête Parcellaire" ex:
P18943-PV.pdf
P18943-Minute-PV.pdf
P18943-Plan.pdf
P18943-ZN2.pdf
P18943-Plan.dxf

In short, the goal is to create the parent folder with the same name as the files and drag all the files with the same name (ex: P18943-.... etc. or
P18944 -.... etc, Or...etc) let's choose sub-folder 1: "Enquête Parcellaire".

Thank you for your help
Attachments
capture1.JPG
capture1.JPG (30.37 KiB) Viewed 3286 times

Post Reply