Page 1 of 1

Create Directory (folders) or the old DOS cmd md

Posted: 26 Sep 2012 05:07
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

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

Posted: 26 Sep 2012 05:44
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"); 

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

Posted: 26 Sep 2012 16:41
by byteme67
Thanks, serendipity!

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

Posted: 27 Sep 2012 16:49
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"); 

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

Posted: 27 Sep 2012 17:01
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");