Create Directory (folders) or the old DOS cmd md

Discuss and share scripts and script files...
Post Reply
byteme67
Posts: 14
Joined: 07 Aug 2012 17:32
Location: SWFL

Create Directory (folders) or the old DOS cmd md

Post by byteme67 »

I am working on cleaning up my MP3 files and love using XY to do it. But here is my dilemma that I am faced with. I have a batch file, (yeah yeah I know old school) anywhoo, as I was saying batch file that creates about 6 new folders under an artists name. What I do is copy this file from a root directory and place it into the artist I am working on then run the batch file and viola I have my six new sub folders. Then I delete the file from the artists folder that I am working on because I don't need it in there anymore.

So I was thinking "How about I write a script and use in XY that would create those new folders for me each time press a shortcut key or icon or menu choice." Anyone have any direction they could point me in. I looked in the help but couldn't find anything. Or maybe someone could be kind enough to give me just the beginning lines that I might need to accomplish this task?

BTW here is the batch file I am using.

Code: Select all

@echo off
md .\Albums
md .\Compilations
md .\EP
md .\Live
md .\Other
md .\Remix
md .\Single
md .\Soundtrack

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Create Directory (folders) or the old DOS cmd md

Post by serendipity »

byteme67 wrote:I am working on cleaning up my MP3 files and love using XY to do it. But here is my dilemma that I am faced with. I have a batch file, (yeah yeah I know old school) anywhoo, as I was saying batch file that creates about 6 new folders under an artists name. What I do is copy this file from a root directory and place it into the artist I am working on then run the batch file and viola I have my six new sub folders. Then I delete the file from the artists folder that I am working on because I don't need it in there anymore.

So I was thinking "How about I write a script and use in XY that would create those new folders for me each time press a shortcut key or icon or menu choice." Anyone have any direction they could point me in. I looked in the help but couldn't find anything. Or maybe someone could be kind enough to give me just the beginning lines that I might need to accomplish this task?

BTW here is the batch file I am using.

Code: Select all

@echo off
md .\Albums
md .\Compilations
md .\EP
md .\Live
md .\Other
md .\Remix
md .\Single
md .\Soundtrack
Hi,
Actually XY scripting is very straightforward. Here is the code:

Code: Select all

//Create new empty folder
  new ("Albums", "dir"); 
  new ("Compilations", "dir"); 
  new ("EP", "dir"); 
  new ("Live", "dir"); 
  new ("Other", "dir"); 
  new ("Remix", "dir"); 
  new ("Single", "dir"); 
  new ("Soundtrack", "dir"); 

byteme67
Posts: 14
Joined: 07 Aug 2012 17:32
Location: SWFL

Re: Create Directory (folders) or the old DOS cmd md

Post by byteme67 »

Thanks, serendipity!

byteme67
Posts: 14
Joined: 07 Aug 2012 17:32
Location: SWFL

Re: Create Directory (folders) or the old DOS cmd md

Post by byteme67 »

Here is some continued working scripting for what I am doing. Thanks to serendipity to get me started. As I work on it be looking forward for some more additions. If anyone has any ideas post here or add to the code.

Code: Select all

// get artists name
 $a = input("Enter Artists Name", , , "s");
 new ("$a", "dir"); // Create new folder from input
 goto "<curpath>\$a", 1;
//Create new empty folder
  new ("Albums", "dir");
  new ("Compilations", "dir");
  new ("EP", "dir");
  new ("Live", "dir");
  new ("Other", "dir");
  new ("Remix", "dir");
  new ("Single", "dir");
  new ("Soundtrack", "dir"); 

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Create Directory (folders) or the old DOS cmd md

Post by serendipity »

One small improvement would be to directly create folders in the user defined location without going there or "goto" command:

Code: Select all

// get artists name
  $a = input("Enter Artists Name", , , "s");
  $userfolder= new ("$a", "dir"); // Create new folder from input
//Create new empty folder
  new ("$userfolder\Albums", "dir");
  new ("$userfolder\Compilations", "dir");
  new ("$userfolder\EP", "dir");
  new ("$userfolder\Live", "dir");
  new ("$userfolder\Other", "dir");
  new ("$userfolder\Remix", "dir");
  new ("$userfolder\Single", "dir");
  new ("$userfolder\Soundtrack", "dir"); 


Post Reply