{"id":2274,"date":"2014-03-18T17:04:55","date_gmt":"2014-03-18T17:04:55","guid":{"rendered":"http:\/\/www.mjtnet.com\/blog\/?p=2274"},"modified":"2014-03-18T17:04:55","modified_gmt":"2014-03-18T17:04:55","slug":"recursion-get-a-list-of-all-subfolders","status":"publish","type":"post","link":"https:\/\/www.mjtnet.com\/blog\/2014\/03\/18\/recursion-get-a-list-of-all-subfolders\/","title":{"rendered":"Recursion &#8211; Get A List of All Subfolders"},"content":{"rendered":"<p>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 <em>recursive list<\/em> &#8211; i.e. one that drills down through all levels.  <\/p>\n<p>To do that you need a recursive function.  In Macro Scheduler we can do this by making a subroutine call itself.  I&#8217;ve added an example on the <a href=\"http:\/\/www.mjtnet.com\/usergroup\/subfolder-recursion-t8185.html\">Scripts &#8216;n Tips forum. Here<\/a>.<\/p>\n<p><a href=\"http:\/\/www.mjtnet.com\/usergroup\/subfolder-recursion-t8185.html\">http:\/\/www.mjtnet.com\/usergroup\/subfolder-recursion-t8185.html<\/a><\/p>\n<p>For a bit of fun go to Google and search for &#8220;recursion&#8221; and see what you get:<\/p>\n<p><a href=\"https:\/\/www.google.com\/#q=recursion&#038;spell=1\" target=\"_new\" style=\"background:transparent;\"><img decoding=\"async\" src=\"https:\/\/dl.dropboxusercontent.com\/u\/20738475\/recursion.JPG\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211; i.e. one that drills down through all levels. To do that you need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/2274"}],"collection":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/comments?post=2274"}],"version-history":[{"count":3,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/2274\/revisions"}],"predecessor-version":[{"id":2277,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/2274\/revisions\/2277"}],"wp:attachment":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/media?parent=2274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/categories?post=2274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/tags?post=2274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}