March 18, 2014

Recursion – Get A List of All Subfolders

Filed under: Scripting — Marcus Tettmar @ 5:04 pm

Someone was asking how to get a list of subfolders. You can do that with the GetFileList command by setting GFL_TYPE to 1. That gives you the folders in the specified path. But it turns out he wanted a recursive list – i.e. one that drills down through all levels.

To do that you need a recursive function. In Macro Scheduler we can do this by making a subroutine call itself. I’ve added an example on the Scripts ‘n Tips forum. Here.

http://www.mjtnet.com/usergroup/subfolder-recursion-t8185.html

For a bit of fun go to Google and search for “recursion” and see what you get: