For one of the loops, store the filenames in a macro and use a repeating build rule to iterate.
http://www.kinook.com/VisBuildPro/Ma...scriptloop.htm
Or put the inner loop in another .bld file and call it with the VisBuildPro Project action.
http://www.kinook.com/VisBuildPro/Ma...projaction.htm