Let CreateDir create a full path

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Let CreateDir create a full path

Post by JRL » Thu Jul 21, 2011 4:22 pm

Help for CreateDir> wrote:CreateDir>directory
Creates a new directory. The directory may be a full path.
To me this implies that CreateDir> will create a full path where none existed before but that is not currently the case. CreateDir> will only add a directory onto the end of an existing path.

One can use the DOS "md" or "mkdir" commands which will create a full path even when none of the directories in the path previously existed. But one could do the same to add a directory onto the end of an existing path. Why bother with CreateDir>? One obvious reason is convenience.

IMHO it would be even more convenient if CreateDir> was capable of creating all of the non existent directories in a specified path.

Thanks,
Dick

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Re: Let CreateDir create a full path

Post by jpuziano » Sat Aug 20, 2011 6:47 pm

JRL wrote:
Help for CreateDir> wrote:CreateDir>directory
Creates a new directory. The directory may be a full path.
To me this implies that CreateDir> will create a full path where none existed before but that is not currently the case. CreateDir> will only add a directory onto the end of an existing path.
That's the impression I get as well. Seems to me either the Help File should be changed to re-word this or... the function should be changed so it actually can do this.
JRL wrote:Why bother with CreateDir>? One obvious reason is convenience.

IMHO it would be even more convenient if CreateDir> was capable of creating all of the non existent directories in a specified path.
I second that thought... great observation JRL.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Post by Grovkillen » Thu Feb 07, 2013 11:56 am

Any ideas if this will be implemented?
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Let CreateDir create a full path

Post by Grovkillen » Thu May 23, 2019 11:03 am

I have created this snippet to do this:

Code: Select all

Let>TEST_PATH=%SCRIPT_DIR%\hello\you\how\are\you\doing
GoSub>CREATE_FOLDERS,TEST_PATH

Let>TEST_PATH=%SCRIPT_DIR%\YO\you\how\are\you\doing
GoSub>CREATE_FOLDERS,TEST_PATH

SRT>CREATE_FOLDERS
  Separate>CREATE_FOLDERS_var_1,\,FOLDER_ARRAY
  Let>TEMP_FOLDER=
  Let>CREATE_FOLDERS_k=0
  Repeat>CREATE_FOLDERS_k
    Let>CREATE_FOLDERS_k=CREATE_FOLDERS_k+1
    Concat>TEMP_FOLDER,FOLDER_ARRAY_%CREATE_FOLDERS_k%
    IfNotDirExists>TEMP_FOLDER
      CreateDir>TEMP_FOLDER
    Endif>
    ConCat>TEMP_FOLDER,\
  Until>CREATE_FOLDERS_k=FOLDER_ARRAY_count
END>CREATE_FOLDERS
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Let CreateDir create a full path

Post by JRL » Thu May 23, 2019 4:25 pm

As I stated in the original post, all you need is DOS. Add Let>RP_Windowmode=0 to avoid the DOS popup window

Code: Select all

Let>TEST_PATH=%SCRIPT_DIR%\hello\you\how\are\you\doing
GoSub>CREATE_FOLDERS,TEST_PATH

Let>TEST_PATH=%SCRIPT_DIR%\YO\you\how\are\you\doing
GoSub>CREATE_FOLDERS,TEST_PATH

SRT>CREATE_FOLDERS
  RunProgram>cmd /c md "%CREATE_FOLDERS_var_1%"
END>CREATE_FOLDERS

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Let CreateDir create a full path

Post by Grovkillen » Thu May 23, 2019 9:16 pm

Thanks for that clean up :)
Let>ME=%Script%

Running: 15.0.24
version history

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts