I'm looking for a solution to the following problem:
-I need to create multiple sequential folders into a specific one, by entering the starting and the ending number (eg. from 500 to 670, it will create 500, 501, 502 up to 670).
I had exactly this requirement a while back so here's a copy of my macro to do it. Its operation is pretty straightforward but make sure you first open a Finder window inside the folder where you want your new folders created.
Thank you so much tiffle,...I just downloaded KM yesterday, so this is something totally new to me and I'm trying to make your macros work...hope to be succesfull
If you need more assistance, just ask. I wrote those macros a long time ago, so if I wrote them now they’d look a bit different and also be more user-friendly! Good luck.
In bash or zsh you can use the command mkdir {500..670} to create the directories you need. In zsh you can pad the numbers with mkdir {001..999}. You can even go crazy with mkdir I\ am\ {a..z}{01..10}\ test\ folder to make folders "I am a01 test folder", "I am a02 test folder" through "I am z10 test folder".
For even more fun use mkdir -p Folder\ {A..Z}/Subfolder\ {01..10} to make folders "Folder A" though "Folder Z" and in each of those folders make "Subfolder 01" through "Subfolder 10".
There is a limit to this -- the shell expands the command into a list of commands, one for each folder to be created. The limit is to the number of characters, so the number of folders that can be created will depend on the length of the path string argument. On my machine I can do more than 8,000 with mkdir I\ am\ {0001..8000}\ test\ folder, so it's it's a usably large limit!
If you do want to make more in a single command (really?!) you can even do a for loop...
So all that's left is to knock the above into something more easily usable, maybe using KM dialogs to set the options. Hmmm...
An item on my "How does KM work?" list is HTML dialogs -- I'll see if I can knock something up that's a little more user friendly for setting ranges and pre-/post-fix!
Oh dear -- I didn't realise how much HTML etc I'd forgotten (or never really knew...). But, finally, here's a KM "make some folders" macro with an HTML front-end. It may not ever be useful, but it was a good learning experience.
You can set one or two ranges (either numbers, padded numbers, or letters) plus none, any or all of prefix, inter and postfix constants for your folders. The first and last folder names plus destination will be previewed at the bottom. So you could make folders "1" to "9", "01a test" thru "99z test", "test-01-project-A-folder" thru "test-99-project-Z-folder", etc.
The script will catch most of the problematic "special" shell characters, while letting you use spaces and similar. "Illegal" entries will have their field red-boxed to warn you. I haven't tried accented characters though! If you want to see the shell command that'll be used, remove the "--" at the beginning of the "display dialog" line in the AppleScript.
I would apologise for the horrible web page -- both the code and the look -- but I really can't be bothered!