Create Folder and Subfolder with prompt

Dear All,

I am looking for a solution to the following problem:

For each new client that I have, I want to create a main folder. Within that mainfolder I have one subfolder with "General stuff" and another one for each matter. So for each new client I want to create those overall 3 folders within one shortcut.

My idea was to start with a prompt, asking for the "case number" and the "clients name".
Then the main folder will be created at a specific path, with the name, containing the variables case number and client name, eg. "0164 (Apple)"
Afterwards in that folder, I want the subfolder "0164-0001 (General Stuff)" and "0164-0101 (Apple, re: Samsung).

I was looking into using apple script with "mkdir -p" which works in general. However, I am not able to use variables. Anyone has an idea how to solve that issue and create the folders with variables? I need to prompt the assigned case number by hand, and also the new client and matter.

Thanks for your help!

Here's a macro I quickly put together for you. You'll need to change the value of the LocalClientFolders variable (the first action) to be where you want your main client folders to be created. After that the macro prompts you for the Case, Client and Matter and then creates folders for you following your description. If it's not quite right I'm sure you'll be able to follow the logic as it is very straightforward. And there's no need to dive into shell commands - KM can do all this very easily.

Also, change the hot key trigger to be what you want.

Hope this helps and good luck!

Test.kmmacros (3.5 KB)

Oh well tiffle just beat me to it, so I will have to be quicker next time.
I have the same solution, but am posting it anyway as it shows a little more what is going on, which may be helpful. Note especially the "/" between the variables.

=========================================================

1 Like

Thank you two very much! Excellent and quick help! Amazing! I does exactly, what I want!