Combining different folders with similar starting names

Thank you very much for that idea Raymundo - it's working nicely.
Is there a way to access "Group folders" through a script and/or pipeline editor as a process?

And yes all the folders belong to the same Subject.