Keyboard Maestro “Create Client Folders” Macro

On Twitter I praised the ability for KM to create some folders automatically for me. Truth be told, I found most of the information on how to do this within the forum, then applied it to my situation.

I later received a request on Twitter to provide information on how I did this. So for anybody who may be interested, this is the macro I built. To run it I select the parent folder, then activate the macro.

I actually started off wanting KM to create the parent folder (the client name) as well, and then populate the sub-folders. I thought KM could prompt for a folder name, then build the structure. But that got too tricky for my limited skills, so I gave up and just create the parent folder and name it in Finder, then run this macro.

1 Like

This is exactly how to use Keyboard Maestro. When you start with a task you want to complete that is rather complex, and then automate some part of it. Then later one maybe you automate some other part. And then another. And then you put them all together. Or maybe you don't but you're still winning in the meantime.

Are all your client folders in the same folder? Or do you want to select the folder to create the client folder in, or do you want to open the folder the folder to create the client folder in (ie, have you selected the client's parent folder, or do you have a window open that is to be the client's parent folder?).

The easiest case would be the first one, a consistent folder for all your clients. Say ~/Clients. Then you would do this:

  • Prompt for User Input action to ask for the client name in MyClient variable.
  • New Folder action “~/Clients/%Variable%MyClient%”
  • New Folder action “~/Clients/%Variable%MyClient%/Client Data”
  • New Folder action “~/Clients/%Variable%MyClient%/Appendices”

If you want to select the folder that will be the client's parent folder, then use exactly the same For Each you ware already doing, and replace “~/Clients” with “%Variable%Path%”, so for example:

  • New Folder action “%Variable%Path%/%Variable%MyClient%”
  • New Folder action “%Variable%Path%/%Variable%MyClient%/Client Data”
    • …

If you want to put it in the front Finder window, that is slightly trickier since there is no built in way to get the path of the front Finder window, so you need to use some AppleScript like the start of the script in this forum post:

2 Likes

Hey Andrew,

You may want to take a look at this: Automate Folder structure.

-Chris

1 Like