Then youve got to go into scripting. Ive written some basic code for that. It assumes you are in your parent folder, looks into each subfolder (and just those, no recursive content enumeration / no subsubfolders...) and if at least one file of the filetypegroups image or movie (you have to check your file extensions are in those groups) is found, this folders will be opened. If the file types in the subfolders are mixed (images and videos) i cant say how it will behave (depending on the order the files are read/enunmerated). It just goes over the files and if it finds image first, it is considered as image folder, the same for videos. So just dont mix the file types in subfolders, and ideally just have one folder per type (again because the first folder it found will be opened) or adapt the script on your own. And only if images and videos folders are found, it will work. It worked for my test scenario.
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>do your stuff</label>
<icon1>#newcommand</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>function OnClick(clickData)</instruction>
<instruction>{</instruction>
<instruction> var imgDir = null;</instruction>
<instruction> var vidDir = null;</instruction>
<instruction />
<instruction> //enumerate the directories (looking for image and video folders)</instruction>
<instruction> for (var dirEnum = new Enumerator(clickData.func.sourcetab.dirs); !dirEnum.atEnd(); dirEnum.moveNext())</instruction>
<instruction> {</instruction>
<instruction> var dirItem = dirEnum.item();</instruction>
<instruction> var dirType = GetDirectoryType(dirItem);</instruction>
<instruction> Log(dirItem + " is type " + dirType);</instruction>
<instruction />
<instruction> //check if weve got directories already, else assign htem</instruction>
<instruction> if(!imgDir && dirType == "image")</instruction>
<instruction> imgDir = dirItem;</instruction>
<instruction> if(!vidDir && dirType == "video")</instruction>
<instruction> vidDir = dirItem;</instruction>
<instruction />
<instruction> //if both found, stop here</instruction>
<instruction> if(imgDir && vidDir)</instruction>
<instruction> break;</instruction>
<instruction> }</instruction>
<instruction> //if both found</instruction>
<instruction> if(imgDir && vidDir)</instruction>
<instruction> {</instruction>
<instruction> Log("found");</instruction>
<instruction> var cmd = clickData.func.command;</instruction>
<instruction> cmd.AddLine("Set VIEW=Thumbnails");</instruction>
<instruction> cmd.AddLine("Go \"" + imgDir + "\" DUALPATH \"" + vidDir + "\"");</instruction>
<instruction> cmd.AddLine("Set FLATVIEW=On,MixedNoFolders");</instruction>
<instruction> cmd.Run();</instruction>
<instruction> }</instruction>
<instruction> else</instruction>
<instruction> Log("nothing found");</instruction>
<instruction>}</instruction>
<instruction />
<instruction>//check which files are in dir, if one matches video or img, return this</instruction>
<instruction>function GetDirectoryType(dir)</instruction>
<instruction>{</instruction>
<instruction> var folderEnum = DOpus.FSUtil.ReadDir(dir);</instruction>
<instruction> while (!folderEnum.complete)</instruction>
<instruction> {</instruction>
<instruction> var item = folderEnum.Next();</instruction>
<instruction> if (!item.is_dir)</instruction>
<instruction> {</instruction>
<instruction> if(item.InGroup("Images"))</instruction>
<instruction> return "image";</instruction>
<instruction> if(item.InGroup("Movies"))</instruction>
<instruction> return "video";</instruction>
<instruction> }</instruction>
<instruction> }</instruction>
<instruction>}</instruction>
<instruction />
<instruction>function Log(msg){DOpus.Output(String(msg));}</instruction>
</function>
</button>