Conflict between Utility panel and CreateFolder?

This button

Set UTILITY=filelog 
@set mySource /mypictures
@set myDest /mypictures\Nexus6P
CreateFolder {$myDest}
GO {$mySource} DUALPATH {$myDest}

works as intended, unless the 'Computer' node in the lister tree is selected. Then I get a VFS error message:

If I uncomment the first line and select 'Computer' the button gets greyed out.

Not sure how to understand this. Neither the lister tree nor the utility panel should affect the CreateFolder command, or should they?

The CreateFolder command is usually used to make folders below the current folder, and isn't available in This PC (as you can't make folders there).

(In this case you aren't trying to make a folder under This PC, but passing a full path to CreateFolder is a bit of a bonus feature, not the normal use of it. The check to see if the command is available is done before looking at the arguments to the command in this case.)

Here's a script-button which does the same thing, and is generalised to always open one folder on the left, the other on the right, and to create either folder if they don't already exist:

Test JScript.dcf (5.9 KB)

  • Select Settings -> Customize Toolbars.
  • Drag the .dcf file to your toolbar.
  • Click OK in the Customize window.

For reference, this is the code inside the .dcf file:

function OnClick(clickData)
	var pathLeft  = DOpus.FSUtil.Resolve("/mypictures");
	var pathRight = DOpus.FSUtil.Resolve("/mypictures/Nexus6P");

	var fso = new ActiveXObject("Scripting.FileSystemObject");
	if (!fso.FolderExists(pathLeft))  { fso.CreateFolder(pathLeft);  }
	if (!fso.FolderExists(pathRight)) { fso.CreateFolder(pathRight); }

	var cmd = clickData.func.command;
	cmd.AddLine('Set SOURCE=Left');
	cmd.AddLine('Go "' + pathLeft + '" DUALPATH "' + pathRight + '"');
	cmd.AddLine('Set UTILITY=filelog');

Thanks for the quick reply and the demo script.

That really explains a lot. I was looking for solutions in various other areas before narrowing it down to the lines above.

So if I wanted to get the CreateFolder-functionality without jscript, would this be the right way to do it?

GO /mypictures
CreateFolder Nexus6P
@set myDest /mypictures\Nexus6P

You could do it like this, but only in the next version. I found this sequence of commands caused problems due to a bug I fixed earlier for the next update:

Go /mypictures OPENINLEFT
CreateFolder "Nexus6P" READAUTO=dual
Set UTILITY=filelog

So stick with the script, at least for now.