Macro Request - Add Parts in Assembly to Feature Tree Folder of Same Name

I've done a search but finding anything to do with macros and folders that isn't Windows / file location related is proving tricky.  Hopefully someone has already come up with something for what I'm after.

What I'd like is a macro that will run through my assembly tree and place each top-level component/sub-assembly in to a folder that shares the same name as it.  So for example, this:

Would become:

I'm afraid I haven't the first idea on where to start with a macro so can't offer any attempts for you to critique / improve upon.  Is this achievable?

Note - I'm using SW2018 SP5 on Win10, if relevant.

Thanks all.

SolidworksApi/macros