How to add files to a folder with the folder name as the file name

I’m struggling to accomplish what I believe is probably a very simple task. I have a PowerPoint template in a specific folder. I create video content based on this template. When I create a new course there is a specific naming convention that I must use or my submissions will not be accepted. When I receive an assignment I create a set of folders based on a text file.

I create a text file using the names of the folders.

For example:


Each line becomes a folder in the main course directory. Right now I save the text file as .folders.txt in the main directory and issue the following command in terminal to create the folders.

cat .folders.txt | awk ‘{system("mkdir "$1)}’

Once I have the folders I just copy a PowerPoint file into each folder and then rename it with the same syntax as the folder, with the .pptx file extension.

I am struggling to figure out how to automate this with KM but I know it has to be possible.

Could someone please get me going on the right path?

Thank you in advance!


Hi Brandon,

Here's an example macro that should get you started. Just make sure that the PowerPoint template's file name is correct, and to change the paths to .folders.txt, the template, and where you want the new folders created as appropriate:

PowerPoint Folders.kmmacros (2.5 KB)



Feel free to ask if you have any questions!

This definitely gets me going. Thank you!

How did you trigger the Macro?

Since I didn't need this macro for myself I just triggered it with the editor's Run Macro button:


In your case, since I'm guessing you won't need run this macro frequently enough to assign it a hot key, I'd recommend giving it a status menu trigger or using Trigger Macro by Name.

It probably can be done, and maybe you have provided this, but it would be most helpful if you could just list the exact steps you want to automate.