Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hurleyint1386

macrumors member
Original poster
Sep 4, 2006
39
12
Ok, so I have a file structure that I create for every job that I do. I'm trying to think of the best way to do this and I thought automator would be the best way, but I can't find a way to make it work. I would like to either: Have an input box pop up and ask me the name of my folder, then it will create that folder as well as the designated subfolders that are all the same, or I create the folder with the name, then run a script inside that folder to create those folders. I was hoping to do this with a keyboard combination, but a menu script would work as well. I do program, so if I don't have a quick way of doing it, then this could be a fun way to play around with some OS X programming.
 
Do you mean "file structure" containing folders and files, or just a "folder structure" containing only folders?

It would be pretty simple to write shell commands to make a folder structure. It's just a series of 'mkdir -p xyzzy' commands, where each xyzzy is the pathname of a new leaf folder. The -p option will create intermediate pathname folders, so it's only necessary to explicitly make the leaf items.

There are any number of shell commands that can make files. The simplest is '>filename', which creates an empty file if it doesn't exist.

You can make a "Run Shell Script" action in Automator, that takes input from a preceding dialog. Do the simplest thing possible and just echo the inputs, then look at Automator's Results from the shell script action.

If you've never used Automator before, you should probably spend a little time doing a few tutorials. Those are pretty easy to find with a search engine.

Start simple, understand each step, and then work up to the intended goal step by step.


I have no suggestions regarding what you tried with Automator, since you didn't post anything that could be commented on. Can Automator create folders? Yes. Can it present dialogs asking for folders or filenames? Yes. Given those points, the rest comes down to "What did you try?", so please post what you tried if you want suggestions on it.


EDIT:
... or I create the folder with the name, then run a script inside that folder to create those folders. ...
Or you create a folder, name it, then run a Service on it, and the Service populates the new folder with the desired structure. This means you make an Automator Service.

Or you create a folder, name it, then drop it on an application to have it populated. This means you make an Automator Application.

Those choices, Service or Application, are made when starting a new workflow. You might want to begin with a plain simple Workflow and then when the basic actions are working, make a Service or Application.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.