Use Automator/AppleScript to create multiple subfolders for a project

Discussion in 'Mac Programming' started by ehmjay, Feb 15, 2017.

  1. ehmjay macrumors member

    Apr 26, 2006
    I'm a complete newbie when it comes to scripting/automator but have heard wonders and wanted some help with automating a relatively common task of mine.

    As a video editor, whenever I start a new project I create a project folder with a series of subfolders. Those subfolders are fairly consistent across projects and I'd love to be able to automate the process.

    Is there a way using Automater/AppleScript to create a little Application that when run asks where I want my new folder to be created and what it should be called, then create that folder with a series of subfolders (each with a specific name)?

    There's an app out there called Post Haste that sort of does this already but I'd love to just have a script/automater app I can leave in my dock and run at will.

  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Yes, it's possible to make a little app in Automator that does that.

    First, though, you'd have to tell us exactly what the subfolder names should be.

    A completely different approach is to make a prototype, which you can copy and paste in Finder.

    That is, make a folder and put all the subfolders you want into it, named exactly as you want them. I'd name the top folder something memorable, like "Video Project Prototype". Then when you want to make a new project, select the prototype folder in the Finder, press ⌘C, then go to the folder where you want the project to reside, and press ⌘V. The result should be an exact copy of the entire prototype folder. Next, rename the copy to your new project's name.

    One advantage of using a prototype is there's no app, so you don't have to specify the subfolders, you won't need to test an app to make sure it works, you won't have to fix any bugs in the app, and so on..

    Another advantage is that you can easily change what's in the prototype simply by changing folders, files, etc. using the Finder. That is, you don't need to change an app, you just change folders.

    Personally, I'd probably use a prototype, and I know how to program.

    For example, I use prototype projects in Xcode, rather than setting up new projects every time. That is, I have an existing Xcode project residing in a folder, and I copy & paste that folder to start a new project. There's the Xcode project file, as well as example source files, documentation files, test cases, etc. I just rename a few things and it's ready to go. I have a few different prototypes for the different kinds of common programming projects I generally work on.

    In a few cases there are two closely related project kinds, and what I did is make a composite that starts with all the parts for both kinds of projects. Then I just delete the parts I don't need, depending on what kind of project I'm starting. I think it's easier to delete stuff than to add it for cases like this.
  3. superscape macrumors 6502a


    Feb 12, 2008
    East Riding of Yorkshire, UK
    +1 vote for this approach.

    You could even have a number of different folder structures and pick from them as you see fit. If you're desperately keen to use Automator, it might be fun to make a service to copy the prototype folder structure to wherever you happen to be rather than having to hunt for it.

Share This Page