3

For every new project I start, I create a standard folder structure that looks like this:

(NUMBER) Client Name:
- Subfolder 1
- Subfolder 2
- Subfolder 3
- Subfolder 4

Or like so:

enter image description here

Currently, I copy-paste this from another source folder - wondering if it's possible to add a shortcut to the contextual menu in Finder (pic below), so I can just right-click anywhere and "generate" this folder, with all the subfolders inside? I've had a go using Automator but can't figure it out...

I'm on Mojave (and High Sierra on another machine).

Thanks!

1 Answer 1

1

You could use Automator with a Shell Script action. You can set it to take in "Folders" and use the below code (change the Shell Script action to take arguments instead of stdin).

cd $1
mkdir "[--] Unnamed Client"
cd "[--] Unnamed Client"
mkdir Fonts Photos Quotes "Raw Files"

The script moves to the folder you selected (cd $1). It creates a folder for the client and cd's into it. It creates folders for the contents.


If you're always making the folders in the same place, you could remove the input or change it to "Files and Folders" and change the first cd command to cd to the location where you want the client folder.

6
  • awesome, thank you - I've managed to create it as an Application which works good (I drop the client folder onto it, and it created the folder structure inside - awesome :D) I would really like to get this into the contextual menu if possible though... I've created it as a "Quick Action" which I'm not sure how to run - What settings should I use above the script itself (eg: Workflow receives current text in Finder)...?
    – dannyrus
    Mar 6, 2019 at 4:18
  • To have it show in the contextual menu, you'll need to be right clicking something that it can work with. Folders should work as-is, but Files may mess up the cd command (changing directory to a file doesn't really work). If you have it set to receive the current Folder, then right clicking on any folder will create the hierarchy within that folder. Does that make sense?
    – Ezekiel
    Mar 6, 2019 at 4:56
  • Aha! That is SO awesome :D Thanks so much for your help! Works perfectly :D
    – dannyrus
    Mar 6, 2019 at 6:03
  • So a quick follow-up question - in one of those folders I'd also love to have a file (it's just a template .rtf file that I fill in each time)... can that also be generated when this folder structure is created, or is that much more complex?
    – dannyrus
    Mar 6, 2019 at 6:04
  • @dannyrus generating a .rtf isn't trivial but you could cp (source path) . to copy from the source path to . which is the current directory after cd'ing into the folder: cd <folder>. This would require a template somewhere, though.
    – Ezekiel
    Mar 7, 2019 at 3:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .